Re: Copy files of the same name - keep newest one

From: Jean-Marc Monnez (monnez.jean-marc@AGORA.MSA.FR)
Date: Mon Mar 31 2003 - 04:50:31 EST


By default, cpio does not restore existing files that are "newer or same age". The -u option has to be used to (u)nconditionnaly restore files. cpio cant take care of files >2GB.

Regards.

-- JMM

-----------------------------
Jean-Marc MONNEZ
MSA / AGORA / ATD
monnez.jean-marc@agora.msa.fr
-----------------------------

"Ford, Phillip" wrote :

If you know a file (you can maybe create one with touch) that marks the date
time of the transfer you can use find.  Suppose that file xxx has a time
stamp on it that any file before this time stamp is old and after this time
stamp is new.  Then

Find . -newer xxx

Will find all files newer in modified time then xxx.  There is another form
of -newer that allow you to specify which time value to look at (see man
pages).  Then feed these files in to the cp command.

--
Phillip Ford
Senior Software Specialist
Corporate Computer Center
Schering-Plough Corp.
(901) 320-4462
(901) 320-4856 FAX
phillip.ford@spcorp.com

-----Original Message-----
From: Green, Simon [mailto:Simon.Green@EU.ALTRIA.COM]
Sent: Friday, March 28, 2003 10:29 AM
To: aix-l@Princeton.EDU
Subject: Re: Copy files of the same name - keep newest one

I believe that will overwrite existing files.

If there aren't too many, you might use the "-i" flag, which will prompt you
before overwriting a file.

Simon Green
Altria ITSC Europe s.a.r.l.

AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
AIX FAQ at http://www.faqs.org/faqs/aix-faq/

N.B. Unsolicited email from vendors will seldom be appreciated.

> -----Original Message-----
> From: Theresa Sarver [mailto:tsarver.IFMC@SDPS.ORG]
> Sent: 28 March 2003 15:54
> To: aix-l@Princeton.EDU
> Subject: Copy files of the same name - keep newest one
>
>
> Hi all;
>
> I migrated the contents of one server's /home filesystem to another
> server several weeks ago.  Now I need to go back through and copy any
> files that were created/modified on this old server - onto the new
> server, without affecting/overwriting the existing files on this new
> server. So basically I need to compare time stamps of the files on
> the old/new servers before the file is copied.
>
> Does anyone know, if I use  "cp -Rhp", will it overwrite the
> pre-existing files?  Or will it compare timestamps before copying?
>
> Does anyone know of a better method for accomplishing this task?

*********************************************************************
This message and any attachments are solely for the intended recipient. If you are not the intended recipient, disclosure, copying, use or distribution of the information included in this message is prohibited -- Please immediately and permanently delete.




This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:42 EDT