[SunHELP] syncing/copying files

David Bishop sunhelp at sunhelp.org
Fri Oct 5 18:32:26 CDT 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am tasked with syncing two directorys, sort of.  I have a large directory 
with a ton of files (10K+) of which I want a subsection copied over to 
another directory.  Luckily, all the files I want to move are prefaced by 
known strings (foo, bar, boz), so I wrote a 5 line perl script that slurps up 
a config file that lists all the prefaces we want to copy, then does a 

foreach $preface ($blah){sytem("cp $preface* /target") or die;}.  

That works great.  However, next time I run the script, it copies all the 
same files over again, plus the few additional files.  This is significant 
because even the subsection is 1500+. My question is: how do I copy only the 
new files?  I couldn't find an option in man|info cp that would look to see 
if the files are already there and skip if they are, though there are a ton 
of 'overwrite|symlink|hardlink|whatever' options.  Has anyone done this 
before?  Am I using the Right Tool for the Right Job?  Any help would be 
greatly appreciated.

- -- 
D.A.Bishop
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7vkMMEHLN/FXAbC0RAj7QAJ999AIlMSCLzKR/4ZyvF1Dyg5b1VwCgnM13
C/C5c6kgrXiAXk4vQ7OFtaE=
=taaM
-----END PGP SIGNATURE-----



More information about the SunHELP mailing list