server-tools !?!
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718
  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 --delete -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'