Have rsync only report files that have been updated

When rsync prints out what it did for each file (using one of the detailed flags), it appears to include both files that were updated and files that were not updated. For example, a snippet of my output using the -v flag looks like this:

 rforms.php is uptodate robots.txt is uptodate sorry.html thankyou.html is uptodate 

I'm only interested in files that have been updated. In the above case, sorry.html . It also prints directory names as they appear in them, even if there is no file in the updated directory. Is there a way to filter uptodate files and directories without updated files from this output?

+6
rsync
source share
3 answers

You can pass it through grep:

 rsync -vv (your other rsync options here) | grep -v 'uptodate' 
+4
source share

Rsync output can be carefully configured, see rsync --info=help ; -v is a pretty crude way to get information from modern rsync.

In your case, I'm not sure what exactly you think is "updated." For example, deleted on the receiver? Only files / dirs as well as channels and symbolic links too? Mod / access time or just content?

As a simple test, I suggest you look: rsync --info=name1 <other opts> .

+3
source share

Here is my welcome ... (proven at work and very pleased with it.)

 rsync -arzihv --stats --progress \ /media/frank/foo/ \ /mnt/backup_drive/ | grep -E '^[^.]|^$' 

The important bit is -i for itemize.

Grep skips all output lines (also any resume, as in -h --stats , as well as empty before that, which makes it -h --stats ), except for those that start with a dot: these are those that describe immutable files :

 A . means that the item is not being updated (though it might have attributes that are being modified). 
0
source share

All Articles