Scp -rp Behavior

Home » CentOS » Scp -rp Behavior
CentOS 6 Comments

Hey all,

I’m trying to copy configuration files from my old CentOS 6.6 32 bit machine to my new CentOS 6.6 64 bit machine.

On my 32 bit machine:

[mlapier@mushroom ~]$ ifconfig eth0 Link encap:Ethernet HWaddr 00:19:DB:E5:4E:9F
inet addr:192.168.15.105

When I issue this command on my new 64 bit machine, 192.168.15.101:

scp -pr mlapier@192.168.15.105: /home/mlapier/.thunderbird
/home/mlapier/.thunderbird

It copies all directories and files in 192.168.15.105: /home/mlapier/ to
192.168.15.101: /home/mlapier. I don’t want all that, I just want the
.thunderbird folder and all it’s contents.

The user and group account numbers match on the two machines for this user so that’s not the issue.

When I RTFM this is what I thought it said to do. I’m I misreading the FM or is something weird going on here?


_
°v°
/(_)\
^ ^ Mark LaPierre Registered Linux user No #267004
https://linuxcounter.net/
****

6 thoughts on - Scp -rp Behavior

  • Hey all,

    I’m trying to copy configuration files from my old CentOS 6.6 32 bit machine to my new CentOS 6.6 64 bit machine.

    On my 32 bit machine:

    [mlapier@mushroom ~]$ ifconfig eth0 Link encap:Ethernet HWaddr 00:19:DB:E5:4E:9F
    inet addr:192.168.15.105

    When I issue this command on my new 64 bit machine, 192.168.15.101:

    scp -pr mlapier@192.168.15.105: /home/mlapier/.thunderbird
    /home/mlapier/.thunderbird

    It copies all directories and files in 192.168.15.105: /home/mlapier/ to
    192.168.15.101: /home/mlapier. I don’t want all that, I just want the
    .thunderbird folder and all it’s contents.

    The user and group account numbers match on the two machines for this user so that’s not the issue.

    When I RTFM this is what I thought it said to do. I’m I misreading the FM or is something weird going on here?


    _
    °v°
    /(_)\
    ^ ^ Mark LaPierre Registered Linux user No #267004
    https://linuxcounter.net/
    ****

  • How about escaping dot (with backslash) for the remote machine, or just giving the whole path for remote machine in quotes:

    scp -pr mlapier@192.168.15.105:”/home/mlapier/.thunderbird” /home/mlapier

    ?

    Also, if you want to specify destination directory (say with different name) you will need to end directory with forward slash both on local and remote, like:

    scp -pr mlapier@192.168.15.105:”/home/mlapier/.thunderbird/” \
    /home/mlapier/.thunderbird/

    (this should be one line which didn’t fit for me in one line hence backslash…)

    Valeri

    ++++++++++++++++++++++++++++++++++++++++
    Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247
    ++++++++++++++++++++++++++++++++++++++++

  • When transferring files between machines I use this (in a BASH file)

    scp -P 12345 -p $file aaa.example.com://$file

    Note the colon and 2 slashes.

  • You don’t need any slashes

    The response about the space after the colon was right this and the last time OP posted… Hopefully he reads it this time.