copying folder that includes links.... - SUN

This is a discussion on copying folder that includes links.... - SUN ; Hi, I think this should be easy but I need to copy a folder that contains files/folders and soft links from one server to another. Whats the best way to ensure the links get copied and not the file/folder that ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: copying folder that includes links....

  1. copying folder that includes links....

    Hi,

    I think this should be easy but I need to copy a folder that contains
    files/folders and soft links from one server to another.

    Whats the best way to ensure the links get copied and not the
    file/folder that they point too.

    I will be using this to replicate my jumpstart environment to seconday
    servers.

    Your help is appreciated.

    Thanks

    Paul

  2. Re: copying folder that includes links....

    me wrote:
    > Hi,
    >
    > I think this should be easy but I need to copy a folder that contains
    > files/folders and soft links from one server to another.
    >
    > Whats the best way to ensure the links get copied and not the
    > file/folder that they point too.
    >
    > I will be using this to replicate my jumpstart environment to seconday
    > servers.
    >
    > Your help is appreciated.
    >
    > Thanks
    >
    > Paul


    I should add I want to use scp.

  3. Re: copying folder that includes links....

    On Tue, 08 May 2007 18:25:54 +0100,
    me , in
    <8cWdnQuVwqo4L93bnZ2dnUVZ8tvinZ2d@pipex.net> wrote:

    >+ Whats the best way to ensure the links get copied and not the
    >+ file/folder that they point too.


    >+ I will be using this to replicate my jumpstart environment to seconday
    >+ servers.


    I would use something like rsync to do this. 'rsync -a ...' will do
    this. Here's what '-a' implies:

    -a is a catchall for -rlptgoD

    -r = recursive
    -l = copy symlinks as symlinks
    -p = preserve permissions
    -t = preserve times
    -g = preserve group
    -o = preserve owner
    -D = enables copying of devices (/dev/*) or special files (named
    sockets and fifos)

    I usually do something like "rsync -aPH [here dir] [there dir]",
    unless I'm copying over the network, in which case it looks like
    "rsync -aPHe ssh [here dir] user@remotehost:[there dir]". It will
    prompt for "user@remotehost"'s password over an SSH tunnel.

    Consult the rsync manpage, tho. It has *lots* of switches, not all of
    which I am familiar with.

    You can also instruct tar to copy links, and can be used over an SSH
    tunnel. I think you can even make cpio do what you want, too.

    --
    Consulting Minister for Consultants, DNRC
    I can please only one person per day. Today is not your day. Tomorrow
    isn't looking good, either.
    I am BOFH. Resistance is futile. Your network will be assimilated.

  4. Re: copying folder that includes links....

    In article <8cWdnQuVwqo4L93bnZ2dnUVZ8tvinZ2d@pipex.net>,
    me wrote:
    >Hi,
    >
    >I think this should be easy but I need to copy a folder that contains
    >files/folders and soft links from one server to another.
    >
    >Whats the best way to ensure the links get copied and not the
    >file/folder that they point too.
    >
    >I will be using this to replicate my jumpstart environment to seconday
    >servers.


    `find` to a piped `cpio` would work.

    -tom
    --

    "You can only be -so- accurate with a claw-hammer." --me

  5. Re: copying folder that includes links....

    On May 8, 6:25 pm, me wrote:
    > Hi,
    >
    > I think this should be easy but I need to copy a folder that contains
    > files/folders and soft links from one server to another.
    >
    > Whats the best way to ensure the links get copied and not the
    > file/folder that they point too.
    >
    > I will be using this to replicate my jumpstart environment to seconday
    > servers.
    >
    > Your help is appreciated.
    >
    > Thanks
    >
    > Paul


    Just tar up the directory and scp would be how I would do it !




  6. Re: copying folder that includes links....

    On May 8, 6:25 pm, me wrote:
    > Hi,
    >
    > I think this should be easy but I need to copy a folder that contains
    > files/folders and soft links from one server to another.
    >
    > Whats the best way to ensure the links get copied and not the
    > file/folder that they point too.
    >
    > I will be using this to replicate my jumpstart environment to seconday
    > servers.
    >
    > Your help is appreciated.
    >
    > Thanks
    >
    > Paul


    Example:

    cd /directory

    tar cf . dir.tar

    scp dir.tar host:/directory

    tar xf dir.tar




  7. Re: copying folder that includes links....

    On 5/9/2007 3:11 PM, Franco S. wrote:
    > On May 8, 6:25 pm, me wrote:
    >> Hi,
    >>
    >> I think this should be easy but I need to copy a folder that contains
    >> files/folders and soft links from one server to another.
    >>
    >> Whats the best way to ensure the links get copied and not the
    >> file/folder that they point too.
    >>
    >> I will be using this to replicate my jumpstart environment to seconday
    >> servers.
    >>
    >> Your help is appreciated.
    >>
    >> Thanks
    >>
    >> Paul

    >
    > Example:
    >
    > cd /directory
    >
    > tar cf . dir.tar
    >
    > scp dir.tar host:/directory
    >
    > tar xf dir.tar
    >


    cd /directory
    tar cf - . | ssh host "cd /directory; tar xf -"

    S.
    --
    Stefan Naewe
    stefan dot naewe at atlas-elektronik dot com

+ Reply to Thread