Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!sdd.hp.com!hplabs!hpcc05!hpcc01!lthompso From: lthompso@hpcc01.HP.COM (Larry L. Thompson) Newsgroups: comp.unix.wizards Subject: Re: Using cp to copy only new files Message-ID: <2620002@hpcc01.HP.COM> Date: 5 Jun 91 19:48:34 GMT References: <1407@opus.NMSU.Edu> Organization: HP Corp Computing & Services Lines: 31 >I would like to run a simple shell program to archive data files from >my hard disk to an optical disk. I would like for the archived files >to be directly usable from the archive (i.e. tar is no good). Hence, >what I would like is some way to use the cp command with a qualifier >that says don't re-copy files that already exist - only new ones. > >Either that, or a 'since date' option. Or something similar. Any >suggestions?? Thanks! > >Bryan Emery >Computer Systems Analyst >Lockheed Engineering and Sciences Corp >White Sands Test Facility >---------- > OK this is a two step process. You first need to touch a file somewhere that will be used as the reference data for filtering files that are newer than itself. Now just use this file along with the find command piped into cpio. Like this: find . -newer -hidden -print | cpio -pudmvx Larry ------------------------------------------------------------------------------ Larry L. Thompson Hewlett-Packard Co. Unix: lthompso@hpcmfs.corp.hp.com 3500 Deer Creek Rd 26U-13 HPDesk: larry_l_thompson@hp0000 Palo Alto, CA. 94304 Tel: (415) 857-4437 Un-employed