logo       

Re: What test for cp: msg#00016

sysutils.backup.rsnapshot.general

Subject: Re: What test for cp

On 07/07/06 09:33, Albert Shih wrote:
> Le 07/07/2006 à 07:28:59-0500, Eric Anderson a écrit
>> On 07/07/06 05:51, Andy Smith wrote:
>>> On Thu, Jul 06, 2006 at 08:16:44PM -0500, Eric Anderson wrote:
>>>> FreeBSD does not support the -al flags at this time. I've thought of
>>>> implementing them though.. How many people here would actually use it?
>
> Personnaly all my server run FreeBSD..

Mine too. :)

>>> Could they not just install the GNU cp port and use that?
>> Sure, but I had problems with gcp trying to copy symlinks. I didn't
>> look into it too much though.
>
> and....what kind of problems you've got ?
>
> I just try with gcp (with coreutils-5.2.1 and gcp --version=cp (coreutils)
> 5.2.1), he accept -al option. That's mean I can use it in my rsnapshot
> config ? I ask this because rsnapshot with perl cp take very long time
> (nearly 2 h for every rsnapshot size ~ 100 Go).
>
> Lots of thanks for your answer

gcp of course takes the -al options, however, it fails to recursively
copy a directory that has symlinks in it.

Example:
$ cd /tmp/
$ mkdir test
$ touch test/t
$ ln -s t test/b
$ ls -al test/
drwxr-xr-x 2 anderson wheel 512 Jul 7 09:39 .
drwxrwxrwt 69 root wheel 8704 Jul 7 09:39 ..
lrwxr-xr-x 1 anderson wheel 1 Jul 7 09:39 b -> t
-rw-r--r-- 1 anderson wheel 0 Jul 7 09:39 t
$ gcp -al test/ test2/
$ ls -al test2/
drwxr-xr-x 2 anderson wheel 512 Jul 7 09:39 .
drwxrwxrwt 70 root wheel 8704 Jul 7 09:40 ..
-rw-r--r-- 3 anderson wheel 0 Jul 7 09:39 b
-rw-r--r-- 3 anderson wheel 0 Jul 7 09:39 t

( you can see it made a resolved the symlink and made a hardlink to the
symlink destination, not exactly what I would want, but didn't fail)

However, now do:
$ ln -s /tmp/ test/link-to-dir
$ ls -al test/
drwxr-xr-x 2 anderson wheel 512 Jul 7 09:43 .
drwxrwxrwt 70 root wheel 8704 Jul 7 09:40 ..
lrwxr-xr-x 1 anderson wheel 1 Jul 7 09:39 b -> t
lrwxr-xr-x 1 anderson wheel 5 Jul 7 09:43 link-to-dir -> /tmp/
-rw-r--r-- 3 anderson wheel 0 Jul 7 09:39 t
$ gcp -al test/ test2/
gcp: cannot create link `test2/test/link-to-dir': Operation not permitted


gcp gets an error when copying symlinks that point to directories.
Probably because it is trying to hardlink the destination, which is
illegal (you can't hardlink directories). The linux-base port (based on
FC4) comes with the cp from linux, and it too fails the same way.

For my setup, I let rsync do the hardlinking.

Eric






--
------------------------------------------------------------------------
Eric Anderson Sr. Systems Administrator Centaur Technology
Anything that works is better than anything that doesn't.
------------------------------------------------------------------------

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise