nimex
July 21st, 2011, 12:34 PM
hello, i'm trying to setup a cron job on my centOS 5.5 server and i was wondering how to go about doing it,
i've read some posts on the "great" interwubz about it and i'm not really sure i understand how to do it correctly.
i've got a job i want to run two times a day, say at 09:00 and 15:00(when i'm not availiable to touch the server physically) it would look something like:
"* 9,15 * * * run-parts /etc/cron.daily/mcbackup"
is it enough that i edit a file and call it mcbackup with the command i want it to do and just put it in the /etc/cron.daily/ folder or do i need to add it to some list somewhere?
also i'm looking for a script to delete the oldest file/folder in for example /home/backups/ only the oldest folder not all of the older ones.
thanks for reading my post.
PS: i am quite noob at this cron stuff so take that into concideration ^^
i've read some posts on the "great" interwubz about it and i'm not really sure i understand how to do it correctly.
i've got a job i want to run two times a day, say at 09:00 and 15:00(when i'm not availiable to touch the server physically) it would look something like:
"* 9,15 * * * run-parts /etc/cron.daily/mcbackup"
is it enough that i edit a file and call it mcbackup with the command i want it to do and just put it in the /etc/cron.daily/ folder or do i need to add it to some list somewhere?
also i'm looking for a script to delete the oldest file/folder in for example /home/backups/ only the oldest folder not all of the older ones.
thanks for reading my post.
PS: i am quite noob at this cron stuff so take that into concideration ^^