2 Replies Latest reply on Apr 15, 2011 4:05 AM by James Andrews

    NSH script cp -T does not work as advertised?



      I am trying to write a script to copy files from a primary to a backup server in our environment. I want the script to copy from the primary to the backup but only overwrite if the file on the source server is NEWER than the target.


      According to the man pages the following should work:


      cp -T //SOURCSVR/file.txt  //TARGETSVR/file.txt


      However, rather than not doing the copy if //TARGETSVR/file.txt is NEWER than //SOURCESVR/file.txt, cp -T will ALWAYS copy if the target or source file has changed regardless of which one is newer.


      Has anyone else come accross this? Is it a bug in cp?


      Let me know.