Results 1 to 4 of 4

Thread: How to rsync 2 drives on same machine

  1. #1
    Join Date
    Jun 2006
    Beans
    140

    How to rsync 2 drives on same machine

    I want to create a cron job that rsyncs 2 drives every 3 hours in the same machine. I only used a very simple gui before for rsync but now with ubuntu server things are trickier.

    the rsync options I want are:

    -delete files on target that are not on source,
    -keep permissions

    any suggestions would be great. thanks

  2. #2
    Join Date
    Apr 2006
    Location
    UK
    Beans
    6,646
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to rsync 2 drives on same machine

    What format are the 2 drives (e.g. ext3)?

    The following assumes ext3, since it won't work with vfat (and uncertain re: ntfs).

    In general, the -a option will cover your requirements, with the addition of --delete.

    Code:
    rsync -a --delete /source_folder/ /destination_folder/

  3. #3
    Join Date
    Jun 2006
    Beans
    140

    Re: How to rsync 2 drives on same machine

    Quote Originally Posted by ugm6hr View Post
    What format are the 2 drives (e.g. ext3)?

    The following assumes ext3, since it won't work with vfat (and uncertain re: ntfs).

    In general, the -a option will cover your requirements, with the addition of --delete.

    Code:
    rsync -a --delete /source_folder/ /destination_folder/
    They are XFS

  4. #4
    Join Date
    Apr 2006
    Location
    UK
    Beans
    6,646
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to rsync 2 drives on same machine

    I have never used XFS, but as far as I know it preserves ownership, permissions etc just fine with rsync.

    So the above command should be fine.

    You can see what it all does with:
    Code:
    man rsync
    Perhaps someone with XFS experience might be able to confirm.

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
  •