Problem: I have a simple custom backup script that is set to run whenever my backup drive is detected, this is done via udev. All is well until about halfway down through the script it seems to hang after the rsync command. My code is below:
#!/bin/bash #Mount the Backup Drive wall "backup is starting" mount -U f91b8373-6349-4de3-86e1-6a2557f2c3f7 /media/backupdrive #Get updated package-list mv /media/backupdrive/package-selections /media/backupdrive/package-selections.old dpkg --get-selections >/media/backupdrive/package-selections wall "pacakge list updated" #Run Backup mv /home/user/backup/rsync.log /home/user/backup/rsync.log.old rsync --log-file=/media/backupdrive/backup/rsync.log -ravzX --delete --exclude /var/tmp --exclude /var/lock --exclude /var/run /home /etc /var /usr /media/backupdrive/backup wall "rsync complete" #Sync changes to disk and unmount sync cp /media/backupdrive/backup/rsync.log /home/user/backup/rsync.log umount /media/backupdrive wall "Backup is complete, the logfile can be viewed at /home/user/backup/rsync.log"
Question: What am I doing wrong here, why is the script not continuing after the rsync?
PS - The wall commands are not important to the script I placed them in at various points to troubleshoot, yes I'm new to this :)
Edit - I have tried removing the "z" option as was mentioned on a similar question, however this has made no difference