View Single Post
Old 06-08-2005, 05:40 AM   #5 (permalink)
asshopo
Insane
 
Location: Michigan
Something like (call this file backup.sh):

Code:
#!/bin/bash

#Get current date
TODAY=$(date +%Y%m%d)

mysqldump --all-databases -u <YOURUSERNAMEHERE> --password=<YOURPWDHERE> -r /path/to/backup/directory/mysql-backup_$TODAY.sql

exit 0
And then enter a cron entry like:

Code:
00 1 * * * <YOURSYSTEMUSERNAMEHERE> /path/to/backup.sh
To run the script at 1am, everyday.
__________________
Patterns have a habit of repeating themselves.
asshopo is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43