The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 07-17-2008
wildside wildside is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 5
Thank you danmero for the rsync pointer.
cp -u does not work in OS 10.5 for some reason. I haad looked at that before.

So rsync looks like what i need. I ran some "dry-runs" with it and also some test runs.

using this convention:
$ rsync -vru --progress FolderA/ FolderB/

It only copies files from FolderA that are newer than files in FolderB.
It skips files that are the same size or date.
This is an expect from the rsync man page:

-u, --update This forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file. (If an existing destination file has a modification time equal to the source file's, it will be updated if the sizes are different.)
So what i need to do is force rsync to use update to copy a file if it is equal or newer. NOT if it is ONLY newer.


Any ideas here?