There are many backup tools available to system admins. One well known file sync tool that can be used for file backup is rsync. Databases can be backed up using mysqldump. You will have to create a script that executes these programs and then run this backup script at some time intervals using crontab.
However, life should not be this hard and whaddayaknow, it in fact isn’t.
There are tools available that manage backups for us and we only need to install and configure these.
File backup: fwbackups
Install and then run ‘fwbackups’. The program has a UI, so when using ssh, make sure X-tunneling is enabled. On Windows client systems, use Xming to display the UI, on Linux just SSH to the server with the -X option added. The program has numerous settings and makes backups automatically.
Database backup: AutoMySQLBackup
After installing through apt-get install automsqlbackup, change settings in /etc/default/automysqlbackup . The whole thing is well documented. The only thing one needs to do is to add the automysqlbackup command as a cronjob, as nicely explained here.
That was a lot easier and faster than having to write your own backup scripts. Cheers!