Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
#!/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
languagebash
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.

...