Results 1 to 5 of 5

Thread: rsync help

  1. #1
    Join Date
    Apr 2006
    Beans
    417

    rsync help

    I finally setup my offsite back for /home on my home computer, but my backup copy has been out of sync for a month. So I did a manual rsync to make sure I get it right before I set it as cron job. I left it to run overnight, but I found it this morning coping already existing files. I'm sure I got both folders right and I didn't find duplicates. I will do another manual device to device sync onsite and then try a remote rsync again. My question is: Is there a problem with my syntax? Is is set to copy just changes?
    Code:
    rsync -avH -e ssh --progress user@user.dyndns.com:/home/user /media/backup/user
    Last edited by bakegoodz; August 29th, 2012 at 04:02 PM.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    13,500
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: rsync help

    Using the "-n" switch means that the files will not actually be transferred; that's the "dry-run" option for debugging purposes.

    Next, if you want to make /media/backup/user be identical to the remote's /home/user, you should use /media/backup as the target destination. Otherwise you'll find you have a folder called /media/backup/user/user on the backup host.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: rsync help

    I think that the directories should have the closing slash (/) for rsync to work properly.

    Code:
    rsync -avHn -e ssh --progress user@user.dyndns.com:/home/user/ /media/backup/user/

  4. #4
    Join Date
    Apr 2006
    Beans
    417

    Dry Run

    Your right, but I removed the -n on the command I ran

    I will try it with the closing slash later. I think I'll get them synced again onsite first.
    Last edited by bakegoodz; August 29th, 2012 at 04:10 PM.

  5. #5
    Join Date
    Nov 2006
    Location
    Belgium
    Beans
    3,025
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: rsync help

    Quote Originally Posted by Lars Noodén View Post
    I think that the directories should have the closing slash (/) for rsync to work properly.

    Code:
    rsync -avHn -e ssh --progress user@user.dyndns.com:/home/user/ /media/backup/user/
    IIRC trailing slashes do have meaning, especially on the source dir.so they don't need to be there unless the effect they have suits your needs or intend.

    I usually put a trailing slash on the source dir, and not on the destination dir, because I find that the most intuitive : I think of the trailing (source dir) slash as 'short for .../*'

    so
    Code:
    rsync /home/koenn/   user@server:/backups/koenn
    reads as : contents of /home/koenn/ goes to /backups/koenn

    this also handles the directory issue SeijiSensei pointed out

Bookmarks

Posting Permissions

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