Is it possible to add a line to a crontab to so that a program will run every 15 minutes? how will this line look?
Thank you.
Is it possible to add a line to a crontab to so that a program will run every 15 minutes? how will this line look?
Thank you.
every 15 min 24/24 ?
This is every 10 min, so I let you figure out 15...
05,15,25,35,45,55 * * * * /usr/sbin/dmesg - >>/var/adm/messages 2>&1
Should run every 15 minutes 24 hours a day, 7 days per week.
15 * * * * /bin/nnkill
Ups ... I realized the logic:
10,25,40,55 * * * * /bin/nnkill
No, the above runs at 15 minutes after the hour, every hour, not every 15 minutes
The crontab entry below runs every 15 minutes, 24 hours a day, every day of the year.
*/15 * * * * /usr/sbin/dmesg - >>/var/adm/messages 2>&1
10,25,40,55 * * * * /bin/nnkill
The above should work.
Do I have to leave a space after each comma?
I read somewhere that if crontab file is not formated properly it will be deleted. Is this true?
Ups ... stupid question: how do I actually add the line?
Sorry for this, I'm a .net developer:(
OK
to edit an existing crontab file:
crontab -e
then check :
crontab -l
IF you are to write one from scratch then it would be wise to use this template I use for all crontabs:
# /sm/cron/cronfile.root
# crontab file for the super-user.
#
# ==========================================================================
# F O R M A T
# ==========================================================================
# Minute Hour Month_Day Month Weekday Command
# (0-59) (0-23) (1-31) (1-12) (0-6)*0=sun run-string
# * = in any crontab field represents all legal values.
# Therefore, to schedule the ps(1) cmd to execute at 5:10pm on every
# friday and monday during june, july, august, you would make an entry
# in your crontab fithe that looks like this :
# 10 17 * 6,7,8 1,5 ps>>psfile 2>&1
# The 2>&1 redirects any error msg to the file psfile.
# ==========================================================================
# ==========================================================================
# archive annuelle de l export le 3 dimanche de janvier chaque annee
#00 04 * 1 0 /sm/bin/archive_annuelle >>/sm/log/archive_ann.er 2>&1
# ==========================================================================
Thank you so much! Looks like everything works.