Bash – File Backup Script

This script uses rdiff-backup to backup files on a Linux host using rysnc. The script then sends an email that notifies of it’s completion. Make sure to install the rdiff-backup package on your distro before running it.

Script Notes:

The script uses a nice value of -19 so that it does not interfere too much with other running processes since file copying is a fairly taxing IO process. Also passing the –exclude flag to rdiff-backup allows you to exclude certain directories from being backed up, such as LOST+FOUND.

Bash – MySQL Backup Script

Looking for a script to backup your MySQL databases on a Linux host? Here is a simple bash script that can be used to automate the process in a cron job. The script checks the database integrity then dumps the database to a text file, tar’s it up, and the emails a confirmation of completion.