Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have rsync only report files which were updated

Tags:

rsync

When rsync prints out the details of what it did for each file (using one of the verbose flags) it seems 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 about the files that were updated. In the above case that's sorry.html. It also prints out directory names as it enters them even if there is no file in that directory that is updated. Is there a way to filter out uptodate files and directories with no updated files from this output?

like image 723
nedned Avatar asked Dec 15 '09 05:12

nedned


People also ask

Does rsync only copy changed files?

By default, rsync will only copy new or changed files from a source to a destination. The –update or -u option is used by rsync to skip files that are still new in the destination directory. Also, –dry-run or -n enables us to execute a test operation without making any changes.

Does rsync check for changes?

Also, rsync provides the ability to synchronize a directory structure (or even a single file) with another destination, local or remote. To accomplish this efficiently, by default, it will check the modification times of files.

How do I monitor my rsync progress?

Method 1: Using –progress option to see the rsync progress:Use the “–progress” in the rsync command and “-av” to get a summary at the end of file transfer, consisting of transfer rate, sent/receive bytes, speed of transfer, and total file size.

Does rsync overwrite newer files?

Files that do not exist on the remote-host are copied. Files that have been updated will be synced, rsync will copy only the changed parts of files to the remote host. File that is exactly the same are not copied to the remote host at all.


1 Answers

You can pipe it through grep:

rsync -vv (your other rsync options here) | grep -v 'uptodate'
like image 180
Jeff Avatar answered Oct 12 '22 23:10

Jeff