If a script for use another script for rsync backups, type Time Machine.
But when finish first user program stop
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
File cuentas.txt
account1
account2
..
accountN
When run backup.sh
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
And stop, instead made backup for next user account2