Find the answer to your Linux question:
Results 1 to 8 of 8
Ok, what I am trying to do is use rsync to copy a directory and its contents to a remote server that I access you using ssh. I have been ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru Vergil83's Avatar
    Join Date
    Mar 2004
    Posts
    2,407

    Basic Rsync


    Ok, what I am trying to do is use rsync to copy a directory and its contents to a remote server that I access you using ssh. I have been looking at the man page and I came up with

    Code:
    rsync -arvv -e ssh /home/local_dir ssh_login@server_address:./Backup
    I get an error. Googling gives a reason for the error yet no real solution.

    If I remove the : after the adress it makes the backup on the local computer.

    Any clues about how I can do this simple task?
    Brilliant Mediocrity - Making Failure Look Good

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Looks ok at a glance. What error are you getting?

    You might change the remote path to look like:
    Code:
    rsync -arvv -e ssh /home/local_dir ssh_login@server_address:/home/login/Backup
    where /home/login/Backup refers to the absolute path. At least eliminate that as a possible problem.

  3. #3
    Linux Guru Vergil83's Avatar
    Join Date
    Mar 2004
    Posts
    2,407
    Thanks for the reply, I tried it and got
    Code:
    bash: rsync: command not found
    rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    rsync error: remote command not found (code 127) at io.c(454) [sender=2.6.9]
    I know that rsync is installed on both the local and remote computer.
    Brilliant Mediocrity - Making Failure Look Good

  4. #4
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Hmm. And what if you run:
    $ ssh_login@server_address which rsync

    ?

  5. #5
    Linux Guru Vergil83's Avatar
    Join Date
    Mar 2004
    Posts
    2,407
    Running which rsync from the server gives
    Code:
     /opt/csw/bin/rsync
    Brilliant Mediocrity - Making Failure Look Good

  6. #6
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    I usually use the following switches; rsync -uave but if the error is with rsync rather than your network and you are copying something up for the first time you might consider using scp instead.

  7. #7
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Quote Originally Posted by Vergil83
    Running which rsync from the server gives
    Code:
     /opt/csw/bin/rsync
    Odd path. Is that a Solaris server?

    What I'd recommend is providing, along with your other options:
    --rsync-path=/opt/csw/bin/rsync

    It seems like rsync on the client side is confused by that strange path (even though it's apparently in the user's PATH). So providing it explicitly may be the solution.

  8. #8
    Linux Guru Vergil83's Avatar
    Join Date
    Mar 2004
    Posts
    2,407
    Yes it is a Solaris server.

    And *drum role* it worked! Stating the remote rsync path did the job. Thank you a ton anomie.

    And thanks bigtomrodney, I was guessing at the options.
    Brilliant Mediocrity - Making Failure Look Good

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •