Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Require script to copy NEWER files from one directory to another

Status
Not open for further replies.

SanjInLondon

IS-IT--Management
Jan 5, 2004
1
GB
Hi people,

I simply require a script/ideas on how to copy files from directory 1 to directory 2. However, it must'nt copy if the file if it exists in both directories.

Thank you very much for your assistance.

Regards,
Ratan.
London
 
For starters, man test and look at the -f option. This will test whether a file exists in the destination directory and you can wrap your logic around that to either copy or not as required. HTH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top