Basic Backup Script
-
Hello fellow VPS's
OK, I've just moved a pretty important site from my shared host to the VPS. I've wrote a v basic backup script that I've tested and works fine (yeah for me!)........cheers for the pointers Olly.
Can someone have a quick look and see if it looks ok to you?
This is what I did:
sudo nano backupThen pasted in my script (editted out the security details):
#backup the diretory path into a tarball
tar -cvf backup.tar /PATH TO DIRECTORY#backup the mysql database into an sql file
mysqldump --user=USERNAME --password=PASSWORD --databases DATABASE > /PATHTODUMP.SQL#create a new tarball of the exiting tar & sql file
tar -cvf COMBINED.tar /PATHTODIRECTORY#remove the original sql & tar file
rm /PATHTOORIGINALDUMP.SQL
rm /PATHTOORIGINAL TAR.tarI then run the script:
./backup
And it then works its magic. I've going to create a crontab to run this everyday, with an email alert reminder so that I dowload a local copy.
Will this work ok as a stop gap uptil I figure out rsync (or a tut is posted up)?
Enjoy the weekend folks
Ben.Posted 1 year ago # -
looks fine Ben .. cron/rsync locally to pull the backup from remote.
.. you can multiply this process with sequential backups for each day of the week, is an advanced idea.
Posted 1 year ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
