Log in

View Full Version : Cron Jobs


Chief Pride
15-06-2009, 15:13
I need to make a cron job that will delete all of the files out of a directory and backup my mysql database, then delete the old backup every night at 12 AM.

I have been searching for some good tutorials but they all seem to rely on knowing UNIX, which I haven't the slightest... If anyone could help me out, that would be great. :)

lynca
15-06-2009, 23:02
I do something like this for sql server backups, to delete a file you will have to add the appropriate "rm" command for your files
10 0 * * * cd /home/me/backups; /usr/bin/mysqldump --opt -u DBUSER -pDBPASS DBNAME > databasefile.sql

Here are a couple references for cron jobs,
http://www.linuxhelp.net/guides/cron/
http://www.webmasterworld.com/databases_sql_mysql/3277413.htm

Chief Pride
15-06-2009, 23:39
Thanks alot!