First add your settings at the top of the file and then add a cronjob to periodically execute the script. In the following paragraphs the settings will be explained.
`SOURCES` is an array containing the paths to the folders that should be included in the backup.
`TARGET` the absolute path to the folder where the backup will be saved to. If the `TOSSH` option is used, this should of course be the absolute path on the remote system.
`EXCLUDEFROM` a path to a file containing folders and files that should be excluded from a backup.
`MAILADRESS` if this option is a non empty string, the log of the backup will be send to the email adress contained in this string. For this to work the `mail` command must be set up properly.
`LISTPACKAGES` if this option is set to a non empty string the log of the backup will contain a list of installed packages. For this command to work the `dpkg` command must be installed properly.
`LOG` the name of the log file.
`RSYNCCONF` an array that contains additional rsync flags.
`TOSSH` if this option is set to a non empty string, the backup will be saved on the remote host that this string refrences. **Attention:** Please set the `TOSSHUSER` and `TOSSHPORT` options as well, otherwise the script will probably fail to create a backup successfully.
`FROMSSH` if this option is set to a non empty string the folders refrenced in `SOURCES` will be fetched from the remote host refrenced by this string. **Attention:** Please set the `FROMSSHUSER` and `FROMSSHPORT` options as well otherwise the script might fail to create a backup successfully.
**Attention:** If both the `TOSSH`&`FROMSSH` options are set the script will fail!
This example can be used for a full system backup (use only "/" as source for a full system backup). Copied from the [Arch Wiki](https://wiki.archlinux.org/index.php/rsync#Full_system_backup).