Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Aug 2004 16:20:56 -0500
From:      "W. D." <WD@US-Webmasters.com>
To:        freebsd-questions@freebsd.org
Cc:        Moti Levy <moti@flncs.com>
Subject:   Re: Copy all files and subdirectories preserving time stamp?
Message-ID:  <5.1.0.14.2.20040823161545.0730a950@209.152.117.178>
In-Reply-To: <412A2293.9090808@flncs.com>
References:  <5.1.0.14.2.20040823115109.04717ec0@209.152.117.178> <5.1.0.14.2.20040823115109.04717ec0@209.152.117.178>

next in thread | previous in thread | raw e-mail | index | archive | help
At 12:00 8/23/2004, Moti Levy wrote:
>W. D. wrote:
>
>>Hi folks,
>>
>>What would be the way to copy all files and subdirectories
>>from one directory to another--preserving the time stamp
>>and other attributes?
>>
>>It seems that 'cp' usually puts a time stamp of the=20
>>current date and time.
>>
>>Would this work?
>>
>>cp -r -p -@ /some/source/directory/* /some/target/directory/
>>

>>
>try using tar ,
>cd /some/source/directory/
>
>tar cfP - *|(cd /some/target/directory/ ; tar xfP - )

Thanks, Moti!  I tried this but got an error:

  tar: You may not specify more than one '-Acdtrux' option

So, I googled for:
http://www.Google.com/search?q=3Dtar+copy+directories+attributes

and found a neat LinuxMafia page.  I sucessfully tried this:

  rsync -av /some/source/directory/ /some/target/directory/


Start Here to Find It Fast!=99 ->=
 http://www.US-Webmasters.com/best-start-page/
$8.77 Domain Names -> http://domains.us-webmasters.com/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.0.14.2.20040823161545.0730a950>