Here is a quick and dirty script to do automated backups of a mysql database. If you want the script to be executed hourly (as is in my case), place it in your /etc/cron.hourly directory. In my case, I dump the backups onto /local/backups directory which happens to be mirrored via raid1.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh
x=`date +%d-%H`
abrcimsfile1="v2edclite${x}"
abrcimsfile2="abrcimsv1${x}"
mysqldump -u root -p
v2edclite_v1 > /local/backups/$abrcimsfile1
mysqldump -u root -p abrcims_v1 > /local/backups/$abrcimsfile2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
No comments:
Post a Comment