server-tools !?!
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

19 行
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'