View Single Post
Old 02-21-2013, 07:56 AM   #2 (permalink)
nancy30
The Wanderer
 
nancy30's Avatar
 
Join Date: Feb 2013
Location: London
Posts: 8
Thanks: 1
nancy30 is on a distinguished road
Default

Create a shell script and save it somewhere like /root/mysqlbackup.sh, because it will contain your mysql password so needs to be kept safe.

Code:
#!/bin/sh

DAY=`/bin/date +%Y%m%d`
mysqldump DATABASE -u USERNAME -pPASSWORD > /path/mysql.yourdomain.$DAY.sql

and do

chown root:root /root/mysqlbackup.sh
chmod +x /root/mysqlbackup.sh
Then set this to be executable as a cron job. Job done!
nancy30 is offline  
Reply With Quote