draft0 - a shared blog by just some people

Menu

Backup Shell Script

This entry is an update of the entry 'Automatic backups with rsync under Linux'.
There is a newer version of this entry: 'backup.sh'.

This is an outdated version of my backup script. I've posted a newer version here.


Here is an updated, more versatile version of the simple backup script I posted before. It takes arguments now (wow)! So now you need only one backup.sh and in your cron tab or similar you can pass it the directory you would like to back up.

For example backup.sh /home/user UsersHomeDir will back up the home directory of user to the predefined location.

In preperation you only need to mount the drive you would like to back up to and enter the mount point (or a path inside it) at the top of the script (variable $BUDIR). In this destination folder (which can be an external drive or a NAS) backups are organised in directories named by the host name of the machine the script was executed on and the name of the backup job (the second argument). By default it will keep 8 incremental backups per backup name. This can be changed with the variable $NUM.

If you give the script only one argument it will interpret it as a name of a file that contains the directories that you want to back up.

If you pass no argument to the script it will look for such a file in the location that is pre-defined at the top of the script (variable $LIST).

You can download the script here if you want to.

Comment via email
Mastodon