list of files at the rsync destination

Tim Conway conway at us.ibm.com
Wed Mar 17 20:03:57 GMT 2004


If you must "push" the transfer to the destination, push over the listing 
from the run, after you're done.
If you can "pull" the transfer to the destination, you can take the list 
directly from the rsync process, and use the output to drive the process 
of running the commands in real time, rather than waiting for the rsync 
run to finish.
Don't forget your "-v".

If the destination is static, except for the rsync update:
before the run
find destination -type f -print |sort|xargs sum >beforefile
after the run
find destination -type f -print |sort|xargs sum >afterfile
diff beforefile afterfile |awk "/^$destination/{print \$1}" |sort|uniq 
|while read file
do
[ -f "$file" ] && yourcommand $file
done

Tim Conway
Unix System Administration
Contractor - IBM Global Services
conway at us.ibm.com


What is the best way to get the list of filenames being transferred to the 
destination -- from the destination side? We are not running in daemon 
mode. We'd like to run a command on each file on the destination after the 
file has completed rsync-ing. 





More information about the rsync mailing list