This is a simple script I use, to backup and synchronize certain direcotries on my machines. The problem was, that I wanted my Documents and other directories to be present on three different machines, all holding the same content. I use rsync to push those folders to my server and pulling them the same way on other machines. This script is merely a wrapper around rsync, allowing to achieve this in a even simpler manner.
./install
This will place the script and two symlinks in /bin
, and a example configuration file in /etc/rbackup.conf
.
After installation, you can find the config file /etc/rbackup.conf
, which you should copy to ~/.config/backup.conf
and edit.
Each line of the file is one backup strategy, consisting of a name, the directory to backup, the remote host address and the remote directory, where the backup will be put.
Example:
# NAME BACK_THIS_UP REMOTE_URL WHERE_TO_PUT_IT documents /home/exampleuser/Documents/ exampleuser@host backups/
The backup target musst be specified as full path. The remote url musst be smth, rsync understands, so, another folder on the local machine or a mounted drive is also possible. The remote location can be relative to the home dir of the user in the url.
After configuration, execute the following, to back the directory up:
push NAME
Where NAME is specified in the config file. The following pulls the backup to its original location:
pull NAME
All rsync command line arguments can specified. In addition, see --help
for additional arguments.