Ensuring that rsync doesn't try to write to an unmounted drive

Chris cpollock at embarqmail.com
Tue Sep 11 16:28:29 UTC 2018


I have a script that runs nightly as a cronjob to backup my drive to a
USB drive https://pastebin.com/yivqrGUC On the command line I use the
--timeout option. Is this sufficient to ensure that if the external
drive somehow becomes unmounted that rsync will gracefully fail without
trying to write to the hard drive instead of the USB drive?

rsync -vaWSHpl --timeout=15 --delete-excluded --filter "merge
${EXC_FILE}" / "${BACKUP_DIR}" > /home/chris/rsyncbackup.log 2>
/home/chris/rsyncbackup.errors.log 

If this is sufficient or would it be better if I lowered the 'timeout'
to 5 seconds?

Thanks for any suggestions/advice.

Chris

-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11972; -97.90167 (Elev. 1092 ft)
11:18:25 up 18:25, 1 user, load average: 1.18, 1.41, 1.43
Description:	Ubuntu 18.04.1 LTS, kernel 4.15.0-34-generic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/rsync/attachments/20180911/7d726142/signature.sig>


More information about the rsync mailing list