Running a cron job at 2:30 AM everyday
crontab -e add: 30 2 * * * /your/command
crontab -e add: 30 2 * * * /your/command
I’m not entirely sure what you mean by “run my own cron tasks manually”. For cron specifically, you need access to crontab, which they can control, as they’re their servers. If you have another way of doing it, it would probably be fine, but bear in mind that your app is not tied to a … Read more
Since cron runs jobs time-based, not interval-based, there’s no blindingly simple way to do it. However, although it’s a bit of a hack, you can set up multiple lines in crontab until you find the common denominator. Since you want a job to run every 72 minutes, it must execute at the following times: 00:00 … Read more
In Vixie cron, which is possibly the most common, you can do this almost exactly like a shell script. VARIABLE=value PATH=/bin:/path/to/doathing 0 0 * * * doathing.sh $VARIABLE The man page says: An active line in a crontab will be either an environment setting or a cron command. An environment setting is of the form, … Read more
Cron utility is an effective way to schedule a routine background job at a specific time and/or day on an on-going basis. Linux Crontab Format MIN HOUR DOM MON DOW CMD Example::Scheduling a Job For a Specific Time The basic usage of cron is to execute a job in a specific time as shown below. … Read more
Run it every three days… 0 0 */3 * * How about that? If you want it to run on specific days of the month, like the 1st, 4th, 7th, etc… then you can just have a conditional in your script that checks for the current day of the month. if (((date(‘j’) – 1) % … Read more
To run a task every 20 minutes starting at 5 past the hour, try this: 5-59/20 * * * * Explanation An * in the minute field is the same as 0-59/1 where 0-59 is the range and 1 is the step. The command will run at the first minute in the range (0), then … Read more
That’s not possible with a single expression in normal cron. The best you could do without modifying the code is: 0 0,3,6,9,12,15,18,21 * * * [cmd] 30 1,4,7,10,13,16,19,22 * * * [cmd] These might be compressible, depending on the version of cron you have to: 0 */3 * * * [cmd] 30 1-23/3 * * … Read more
From here: Cron also supports ‘step’ values. A value of */2 in the dom field would mean the command runs every two days and likewise, */5 in the hours field would mean the command runs every 5 hours. e.g. * 12 10-16/2 * * root backup.sh is the same as: * 12 10,12,14,16 * * … Read more
Linux Crontab Format MIN HOUR DOM MON DOW CMD 0 11 * * * filename Crontab Fields and Allowed Ranges MIN Minute field 0 to 59 HOUR Hour field 0 to 23 DOM Day of Month 1-31 MON Month field 1-12 DOW Day Of Week 0-6 CMD Command Any command to be executed For More … Read more