25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/bin/bash
-
- BACKUP_TARGET=W.X.Y.Z
- BACKUP_PORT=XXX
- BACKUP_MAC=AA:BB:CC:DD:EE:FF
- BACKUP_TARGET_ROOT=/data/allella/
- TRANSFERT_USER=backupuser
-
- # First wake up ${BACKUP_TARGET} and wait ...
- wakeonlan -i ${BACKUP_TARGET} ${BACKUP_MAC}
- sleep 180
-
- # Then
- echo "Starting to push backup using ${BACKUP_TARGET}:${BACKUP_TARGET_ROOT}"
- rsync -azp --delete -e "ssh -p ${BACKUP_PORT}" /backup /data ${TRANSFERT_USER}@${BACKUP_TARGET}:${BACKUP_TARGET_ROOT}
-
- # Stop
- ssh -p ${BACKUP_PORT} ${TRANSFERT_USER}@${BACKUP_TARGET} 'sudo shutdown -h'
|