...
Code Block | ||
---|---|---|
| ||
#!/bin/bash su - remotebackup && rsync -av --delete -e ssh remotebackup@ip:/source/ /destination/ #you must be remotebackup user to run this command in the script |
To test run scripts the command is
...
Code Block | ||
---|---|---|
| ||
vi /etc/crontab 0TAB5TAB*TAB*TAB*TABrootTABsu - remotebackup TABrootTAB/path/to/script.sh #The cronjob must be run by the root user or the cronjob will not work and you must use TABS instead of spaces. |
...