View Single Post
Old 10-06-2016, 02:02 PM  
robwod
Confirmed User
 
Industry Role:
Join Date: Nov 2005
Posts: 2,539
Quote:
Originally Posted by CyberSEO View Post
I don't know about a universal solution. I do backup databases and files with separate scripts. Actually it's not a big deal to write a script which will do both things simultaneously and perhaps it already exists somewhere..
Yes, a simple bash script. In a simple text editor, a person could enter the following and save it as backups.sh

Code:
# ##########################################################
# DUMP DATABASE(S)
# ##########################################################

mysqldump --user=root --password='whatever' --host=localhost databasename > databasename.sql

# ##########################################################
# TAR WEBSITE(S)
# ##########################################################

tar -cpf domainname.tar /path/to/domainname.com

# ##########################################################
# MOVE FILES TO BACKUP FOLDER
# ##########################################################

mv databasename.sql /path/to/backups/
mv domainnanme.tar /path/to/backups/
You could of course, dump/tar and move at one time, but this just explains it relatively easy.

All one needs to do then is to add a cron job to execute backups.sh nightly.

Code:
0 0 * * * /bin/bash /path/to/backups.sh > /dev/null
That's it, now your databases and all files for the specified domain are backed up every night at midnight. If you want to store them on a separate server, rsync will let you connect to any of your other hosts and you can transfer them in similar fashion, through a simple bash script and a cronjob.

And these command line instructions remove any dependency on a third party plugin and are included with any basic *nix server.
__________________
NSFW
robwod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote