rsync 백업을위한 다른 스크립트를 사용하는 스크립트에 Time Machine을 입력하십시오.비정상 종료 양식 bash 스크립트
그러나 마무리 첫 번째 사용자의 프로그램은
backup.sh
#!/bin/bash
while read A; do
echo $A
ssh [email protected] "[[ -d /Volumes/MACBACKUP/desarrollo_backups/$A ]] || mkdir /Volumes/MACBACKUP/desarrollo_backups/$A; touch /Volumes/MACBACKUP/desarrollo_backups/$A/backup.marker"
bash /home/vagrant/rsync_tmbackup.sh $A/ [email protected]:/Volumes/MACBACKUP/desarrollo_backups/$A/
done < cuentas.txt
파일 backup.sh 실행
account1
account2
..
accountN
cuentas.txt
account1 # comment first iteration on while
rsync_tmbackup: Previous backup found - doing incremental backup from [email protected]:/Volumes/MACBACKUP/desarrollo_backups/account1/2016-11-03-075246
rsync_tmbackup: Creating destination [email protected]:/Volumes/MACBACKUP/desarrollo_backups/account1/2016-11-03-080415
rsync_tmbackup: Starting backup...
rsync_tmbackup: From: castris
rsync_tmbackup: To: [email protected]:/Volumes/MACBACKUP/desarrollo_backups/account1/2016-11-03-080415
rsync_tmbackup: Running command:
rsync_tmbackup: rsync -e 'ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' -D --compress --numeric-ids --links --hard-links --one-file-system --itemize-changes --times --recursive --perms --owner --group --log-file '/home/vagrant/.rsync_tmbackup/2016-11-03-080416.log' --link-dest='/Volumes/MACBACKUP/desarrollo_backups/account1/2016-11-03-075246' -- 'castris/' '[email protected]:/Volumes/MACBACKUP/desarrollo_backups/account1/2016-11-03-080415/' | grep -E '^deleting|[^/]$'
Warning: Permanently added '192.168.1.33' (ECDSA) to the list of known hosts.
rsync_tmbackup: Backup completed without errors. # Here finish first iteration on while, and muts be with second iteration, but bash end while
을 중지하고 중지 할 때 , inste 다음 사용자 account2에 대한 광고 작성 백업
ssh -n 해결되지 않습니다. 문제점은 ssh 명령을 실행 한 후가 아니라 bash 프로그램 rsync_tmbackup.sh를 실행 한 후 "후"입니다. 감사. – abkrim
@abkrim, rsync_tmbackup.sh에서도 ssh 명령을 사용합니다. 스크립트에서 이것을 변경할 수도 있습니까? rsync -e 'ssh -n -p ... –
왜? 나는 ssh 명령을 실행하는 것을 좋아하지 않는다. 제 질문은 다른 것입니다. 잠시 동안 첫 번째 반복을 실행 한 후 실패 bash 스크립트에 관한 질문입니다. ssh 프로그램의 라인입니다. bash ... bash 스크립트의 다른 줄입니다. – abkrim