The shebang is incomplete and you don't need bash for that script so:
- Code: Select all
#!/bin/sh
Scorpion wrote:- Code: Select all
sudo rsync -aAuHXvis --progress --delete --numeric-ids /media/root/LM18_timeshift/ /media/steve/Z97_LM_Backup/LM18.3_timeshift_backup/timeshift | tee ~/timeshift_backup_log
That command copies
from /media/root/LM18_timeshift/
to /media/steve/Z97_LM_Backup/LM18.3_timeshift_backup/timeshift, which seems to be the opposite of your stated intention. And be careful with the trailing slash on the source directory:
http://qdosmsq.dunbar-it.co.uk/blog/201 ... -to-slash/You don't need a pipe (|) and the tee command to direct output to a log file so replace the bit after the rsync command with
- Code: Select all
> ~/timeshift_backup_log 2>&1
And it's probably best to flush the copy buffers after the command runs rather than wait 10 seconds (the Mint poster seems to think the sleep command is for 10 minutes but it isn't):
- Code: Select all
sync
No need for the 'exit 0' line either, the script will have a zero exit status if it completes successfully anyway.