backup.sh 294 B

123456789101112
  1. #!/bin/bash
  2. vpngateway='172.16.255.1'
  3. vpngatewayport='22'
  4. backupsource='/data/nextcloud2/'
  5. backupdest='/backup/'
  6. destusername='simon'
  7. destport='27022'
  8. test=$(ssh -p $vpngatewayport root@$vpngateway -C 'cat /root/home.ip')
  9. rsync -av -e "ssh -p $destport" $backupsource simon@$test:$backupdest