Results 1 to 5 of 5
hi all
i'v got this entry in my crontab file
* * * * * /bin/date >/tmp/date.out 2>&1
can anyone tell me what this means?
thank you...
- 11-06-2007 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 16
Cron file
hi all
i'v got this entry in my crontab file
* * * * * /bin/date >/tmp/date.out 2>&1
can anyone tell me what this means?
thank you
- 11-06-2007 #2"I'm just a little old lady; don't try to dazzle me with jargon!"
- 11-06-2007 #3Just Joined!
- Join Date
- Oct 2007
- Posts
- 16
thank you
i will remove it
- 11-07-2007 #4
#--------------------SYNTAX--------------------#
# min(0-59) hour(0-23) dayOfMonth(1-31) month(1-12) dayOfWeek(0-6) (sun=0)
#
# Every 5 minutes, for example, can be stated as follows:
# 0-55/5 OR 0,5,10,15,20, and so on
#
# From 8 am to 5 pm can be specified as 8-17 or 8,9,10,11, and so on
#
#------------------END SYNTAX------------------#
Above is the syntax used for cron files. I place this at the tops of my crontabs to remind me of the syntax.
Here are some examples
#The following executes at 1:01 AM every day
01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1
# The following executes every hour (ie: 1:00, 2:00)
00 * * * * /root/.SCRIPTS/GREYLISTING/greylisting-delete-expired.sh
# The following executes at 1:05 AM every day
05 01 * * * updatedb
# The following executes at 1:01 AM every day. NOTE: 01 and 1 are the same. Both work.
1 1 * * * vnstat -u
# The following executes at the bottom of each hour, at 3 AM, on the 1st, 5th, 9th, 14th, 18th, 23rd, 28th of each month, no matter what day it is.
0 3 1,5,9,14,18,23,28 * * /root/AUTOMATION_SCRIPTS/BACKUP/7backups
#* * * * * /root/AUTOMATION_SCRIPTS/JOHN/server
#-------------------PERSONAL-------------------#
# The following line executes at the bottom of each hour, every 2 hours between 8 am and 4 pm, M-F
00 8-16/2 * * 1,2,3,4,5 /root/.SCRIPTS/PERSONAL/drink_water
#-------------------WEBSITES-------------------#
# The following line executes every 5 minutes, every day of the week and month
0-59/5 * * * * /srv/www/htdocs/mydomain.com/contact/format.sh
# The following line executes every 10 minutes
0-55/10 * * * * /srv/www/htdocs/mydomain.com/news/script/news.sh
NOTE: Fields are space delimited. Comma delimited within each respective field. If you want something to execute at 1:01 and 1:05, the syntax is as follows:
CORRECT: 1,5 1 * * * * <command>
INCORRECT: 1, 5 1 * * * * <command>
2>&1 is typically used in this scenario
<some command> > /dev/null 2>&1
Basically, you execute the command, but don't get any output on the screen. You can see I use this in my cron above.
- 11-14-2007 #5Just Joined!
- Join Date
- Oct 2007
- Posts
- 16
jdh239 thank you


Reply With Quote
