This is a simple backup solution for people who run their own web server and MySQL database server on a dedicated or VPS server. Most dedicated hosting provider provides backup service using NAS or FTP servers. These service providers will hook you to their redundant centralized storage array over private VLAN. Since, I manage couple of boxes, http://bash.cyberciti.biz/backup/wizard-ftp-script.php is my own automated solution. If you just want a shell script, go here (you just need to provided appropriate input and it will generate FTP backup script for you on fly, you can also grab my php script generator code).
Making Incremental Backups With tar
You can make tape backups. However, sometime tape is not an option. GNU tar allows you to make incremental backups with -g option. In this example, tar command will make incremental backup of /var/www/html, /home, and /etc directories, run:
# tar -g /var/log/tar-incremental.log -zcvf /backup/today.tar.gz /var/www/html /home /etc
Where,
-g: Create/list/extract new GNU-format incremental backup and store information to /var/log/tar-incremental.log file.
Making MySQL Databases Backup
mysqldump is a client program for dumping or backing up mysql databases, tables and data. For example, the following command displays the list of databases:
Các bài viết khác