From acc74124b5152525078309c2b51ddd7901673239 Mon Sep 17 00:00:00 2001 From: Mark McNally Date: Wed, 30 Jun 2021 18:42:45 +0100 Subject: cron timings explained better, personal ad made less overt --- cron.html | 62 +++++++++++++++++--------------------------------------------- 1 file changed, 17 insertions(+), 45 deletions(-) (limited to 'cron.html') diff --git a/cron.html b/cron.html index cc0ac0d..985a5e8 100644 --- a/cron.html +++ b/cron.html @@ -61,25 +61,21 @@
Crontab expressions look like this * * * * * command-to-run
+
+ So for our Monday at 3:30AM job we would do the following: +
- .---------------- minute (0 - 59) - | .------------- hour (0 - 23) - | | .---------- day of month (1 - 31) - | | | .------- month (1 - 12 - | | | | .---- day of week (0 - 6) - | | | | | - * * * * * + .---------------- minute (0 - 59) + | .------------- hour (0 - 23) + | | .---------- day of month (1 - 31) + | | | .------- month (1 - 12 + | | | | .---- day of week (0 - 6) + | | | | | + * * * * * +30 3 * * 1 apt-get -y update && apt-get -y dist-upgrade
- So for our Monday at 3:30AM job we would do the following: -
- 30 3 * * 1 apt-get -y update && apt-get -y dist-upgrade
-
- Lets add another Job, our backup job (for the purposes of this our backup command is just called backup We want to run backup Every evening at 11PM, once we work out the timings for this we can add the to the same file as the above by running crontab -e This would mean our full crontab would look like this:
+ Lets add another Job, our backup job (for the purposes of this our backup command is just called backup) We want to run backup Every evening at 11PM, once we work out the timings for this we can add the to the same file as the above by running crontab -e This would mean our full crontab would look like this:
-30 3 * * 1 apt-get -y update && apt-get -y dist-upgrade-0 23 * * * backup+ 30 3 * * 1 apt-get -y update && apt-get -y dist-upgrade + + 0 23 * * * backup
- This article was written by Mark McNally + - Mark McNally -- website, Youtube
- 42ueuWXJGP48xtahfnujWDMFHJVdMGeFj85jxuwPBygkVw1GEBbHfTsDFBByTSLXpDV4bKcNr7EPCfvSJpyYLY5HPvqUmRB 36mXUtU6Kh9pmYvGYPLY7peHU4TR7FBATT - Yes I know I need to set up OpenAlias... -
- - - - - - - - -- cgit v1.2.3