Results 1 to 4 of 4
Hi guys, just a quick question on cronjobs.
Code:
* */24 * * * '/script.sh'
will run every 24 hours, correct?
if say for example, the computer was not used ...
- 10-11-2010 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 53
cronjob.
Hi guys, just a quick question on cronjobs.
will run every 24 hours, correct?Code:* */24 * * * '/script.sh'
if say for example, the computer was not used for 36 hours, would this script run as soon as that user was logged on?
Thanks.
- 10-11-2010 #2Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 260
would run at 01:10 AM every day.Code:10 1 * * * /script.sh
would run at midnight every day.Code:0 0 * * * /script.sh
would run at midnight monday through friday.Code:0 0 * * 1-5 /script.sh
The use of "/" is for having multiple times such as I want the script to run on even hours
Which is sort cut over:Code:0 0/2 * * * /script.sh
Code:0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /script.sh
- 10-11-2010 #3Just Joined!
- Join Date
- Dec 2009
- Posts
- 53
* 1/2 * * *
wouldn't this run every odd hour from 1am?
going by that logic then
0 0/24 * * *
would run every 24 hours? isn't it the same as
* */24 * * * ??
what i am looking for is a script to run every 24 hours regardless of what time it is.
the reason being, i have no idea when the user will be logged on, but i wish to run the script when they are, only once per day.
thanks.
- 10-12-2010 #4Linux Guru
- Join Date
- Oct 2007
- Location
- Tucson AZ
- Posts
- 1,928
cron counts from zero so minutes can be: 00 -59, hours 00-23. Try changing your 24 to a 23. Just google cron tutorial and see examples.
Cron Tutorial
CRONTAB Tutorial | LinuxWebLog.com


Reply With Quote

