0

I have a script to backup my images and alert me to the status of the script which gets run every 5 minutes. However, I want to figure out how to identify when rsync was successful, but didn't do anything (no files transferred) so I can not notify when that happens. So line 37 should only print if files were actually transferred. my script

1
  • You probably want to add --verbose and look at the rsync output Nov 1, 2013 at 13:35

1 Answer 1

0

Use the --stats argument to rsync and parse its output. e.g.:

transferred=$(rsync -ar --stats $src $dest | awk '/files transferred/ {print $5}')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .