server-tools !?!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
519 B

  1. #!/bin/bash
  2. BACKUP_TARGET=W.X.Y.Z
  3. BACKUP_PORT=XXX
  4. BACKUP_MAC=AA:BB:CC:DD:EE:FF
  5. BACKUP_TARGET_ROOT=/data/allella/
  6. TRANSFERT_USER=backupuser
  7. # First wake up ${BACKUP_TARGET} and wait ...
  8. wakeonlan -i ${BACKUP_TARGET} ${BACKUP_MAC}
  9. sleep 180
  10. # Then
  11. echo "Starting to push backup using ${BACKUP_TARGET}:${BACKUP_TARGET_ROOT}"
  12. rsync -azp -e "ssh -p ${BACKUP_PORT}" /backup /data ${TRANSFERT_USER}@${BACKUP_TARGET}:${BACKUP_TARGET_ROOT}
  13. # Stop
  14. ssh -p ${BACKUP_PORT} ${TRANSFERT_USER}@${BACKUP_TARGET} 'sudo shutdown -h'