-   Linux - General (
-   -   cronjob (

FastEddy 04-12-2003 12:25 AM

I am running a cron job to backup a database.

1) Is there a way to have the file mailed to me?
2) How can I keep the old file from being overwritten each time the job runs? Can I have the filename change each time it runs?

I would like to run these as 2 separate jobs at different times to keep one set on the server and another off the server.

I have absolutely no clue what I'm doing.
Here is the command line I'm using now.

mysqldump -uXXXXX -pXXXXX -B XXdatabasenameXX> /home/XXXX/backup.sql


pablob 04-12-2003 09:52 PM


file = backup.sql.`date +%w`

mysqldump -uXXXXX -pXXXXX -B XXdatabasenameXX>/home/XXXX/$file
# Adds day of week number. For day of month: +%d

cat /home/XXXX/$file | mail -s Backup

All times are GMT -5. The time now is 04:54 AM.