I am trying to get a cron expression through cron convertors online but it won't be able to do the same.
Some please help. I need a cron expression which should run every 3 hours starting at 00:10.
00:10
03:10
06:10
...
Also I need a cron expression that runs every 30 mins starting from 00:00.
00:00
00:30
01:00
...
something like this^
I tried
10/3 * * * *
and
*/30 * * * *
I need a cron expression which should run every 3 hours starting at
00:10
Simply with
10 0/3 * * * your_command
This way, the cron will run the specified command at 10 minutes past midnight (10 0) and then every 3 hours thereafter (0/3)
Also I need a cron expression that runs every 30 mins starting from
00:00
Then this might do the work
0,30 0-23/1 * * * /path/to/command
So it will run at 00:00 and 00:30 every day (0,30), every hour (0-23/1), and regardless of the day of the month, month, or day of the week (*)
Related
The following cron expression cron(0 14 ? * MON-FRI *) basically runs something 4:00 pm from Monday to Friday.
I am wondering if it is possible to modify the expression so I can run something at 4:00 am and 4:00 pm every Monday to Friday.
Use this crontab line to run command_name at 4:00 and 16:00 (4 AM and 4 PM) Monday-Friday:
0 4,16 * * 1-5 command_name
From crontab manual:
The time and date fields are:
field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sunday, or use names)
Your Cron job description looks different from the general crontab. But to give you an idea of how to achieve what you're looking for:
Edit cron-table. Choose your editor.
crontab -e
Add 2 lines cron jobs.
* 4 * * 1-5 /usr/bin/...# Your command goes here 04:00 am.
* 16 * * 1-5 /usr/bin/...# Your command goes here 04:00 pm.
4PM (16:00): 0 16 * * MON-FRI
See crontab guru
"At 16:00 on every day-of-week from Monday through Friday.”
4AM &4 PM (4:00 & 16:00): 0 4,16 * * MON-FRI
See crontab guru
“At minute 0 past hour 4 and 16 on every day-of-week from Monday through Friday.”
I got this crontab code to run a script on crontab every 15 minutes from 9 to 18 all days except weekends. However I would like to start fro 9:30 instead of 9. Is it there a way to do it?
*/15 9-18 * * 1-5
Using 30/15 in the minute area should work just fine:
30/15 9-18 * * 1-5
This will instruct crontab to run your script: “At every 15th minute from 30 through 59 past every hour from 9 through 18 on every day-of-week from Monday through Friday.”
I finally did this, and it works
30 9 * * 1-5
45 9 * * 1-5
*/15 10-18 * * 1-5
However, it needs three crontab entries.
I am trying to run a script Monday through Friday every 2 hours during working hours (9 am - 4 pm).
I tried this:
0 09-16/2 * * 1-5 /local/bin/script.sh
But now my script runs Monday through Friday from 2 AM to 8 AM. I don't see what's wrong.
Try this
0 9,11,13,15 * * 1,2,3,4,5 /local/bin/script.sh
If I creating cronjob to running for every 2:30 the command will run? (It mean, my cron will running after 90 minutes for every hours.)
the command like: 30 */2 * * * /command/xxx => that's right?
Please help?
Your cron expression 30 */2 * * * will run the command every 2 hours at 30 mins past the hour i.e.00:30, 02:30, 04:30, 06:30 and so on.
If you want to run your command at intervals of two and a half hours i.e. 00:00, 02:30, 05:00, 07:30 and so on, you need to set up two crons:
0 0-20/5 * * * runs at 0 mins past the hour, every 5 hours between 00:00 and 20:00 inclusive i.e. 00:00, 05:00, 10:00, 15:00 and 20:00
30 2-22/5 * * * runs at 30 mins past the hour, every 5 hours between 02:00 and 22:00 inclusive i.e. 02:30, 07:30, 12:30, 17:30 and 22:30
On the other hand, if you want to run your command only once every day at 02:30 use 30 2 * * *.
sudo crontab -e
and then add this:
30 2 * * * /enter/your/command
What is the syntax for a cron job that runs 15 and 45 minutes after the hour? (So every 30 minutes.)
Would the syntax be something like:
15,45,30 * * * * wget -O /dev/null http://somesite.com/4_leads.php
So for example it would run at
2:15
2:45
3:15
3:45
4:15
4:45
and so on
From man 5 crontab
field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sun, or use names)
Or, in other words
# m h dom mon dow user command
15,45 * * * * yourusername wget -O /dev/null http://somesite.com/4_leads.php
Skip the username field if you place the entry in a user specific crontab, via crontab -e, crontab -e -u yourusername, or similar.
This question may be better suited to serverfault.