Page 3 of 7 FirstFirst 12345 ... LastLast
Results 21 to 30 of 67

Thread: Rsync - What's YOUR setup like?

  1. #21
    Join Date
    Jul 2006
    Beans
    4,681

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by CharlesA View Post
    I don't know if it will know if a device is mounted or not. What I did was mount my external to something like /sync and then run something like this:

    Code:
    rsync -ar /storage /sync
    -a = archive, copies all permissions and whatnot
    -r = recursive, copying everything recursively
    So you run that as root, I take it? Since -a requires root to get passed over properly. Otherwise it's just a null switch.

  2. #22
    Join Date
    Apr 2009
    Beans
    1,173

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by Roasted View Post
    So you run that as root, I take it? Since -a requires root to get passed over properly. Otherwise it's just a null switch.
    I never run rsync as root. The -a archive option works as long as there are sufficient permissions to read the source and read / write the destination. It is never a null switch, but it will fail when there is insufficient permission. The --itemize-changes and --verbose (or even --verbose --verbose for extra messages) will give plenty of explanation of what changes are made / skipped.

  3. #23
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by Roasted View Post
    So you run that as root, I take it? Since -a requires root to get passed over properly. Otherwise it's just a null switch.
    I run it with cron. Even when running it manually, it copies it over, but changes the owner, but not the group or permissions. Not quite sure if there is a way to fix that since I've been running rsync as my user account.

    Would running as root fix that?

  4. #24
    Join Date
    Apr 2009
    Beans
    1,173

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by CharlesA View Post
    I run it with cron. Even when running it manually, it copies it over, but changes the owner, but not the group or permissions. Not quite sure if there is a way to fix that since I've been running rsync as my user account.

    Would running as root fix that?
    Cron runs as root. There is no reason why, in a properly mounted set of filesystems, the ownership would change. If you look then you will probably find you have lost file timestamps too.

  5. #25
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by StuartN View Post
    Cron runs as root. There is no reason why, in a properly mounted set of filesystems, the ownership would change. If you look then you will probably find you have lost file timestamps too.
    How would I check for those?

    This is what I get when I check the original:

    Code:
    charles@thor:/array/clone/Osiris_Windows7RC$ ls -l
    total 5110572
    -rw-rw---- 1 clone clone          4 2009-10-14 20:18 disk
    -rw------- 1 clone clone    8904357 2009-10-14 20:05 hda1.ntfs-ptcl-img.gz.aa
    -rw------- 1 clone clone 2097152000 2009-10-14 20:10 hda2.ntfs-ptcl-img.gz.aa
    -rw------- 1 clone clone 2097152000 2009-10-14 20:16 hda2.ntfs-ptcl-img.gz.ab
    -rw------- 1 clone clone 1023773945 2009-10-14 20:18 hda2.ntfs-ptcl-img.gz.ac
    -rw-rw---- 1 clone clone         37 2009-10-14 20:05 hda-chs.sf
    -rw-rw---- 1 clone clone    1048064 2009-10-14 20:05 hda-hidden-data-after-mbr
    -rw-rw---- 1 clone clone        512 2009-10-14 20:05 hda-mbr
    -rw-rw---- 1 clone clone        323 2009-10-14 20:05 hda-pt.parted
    -rw-r----- 1 clone clone          0 2009-10-14 20:05 hda-pt.sf
    -rw-rw---- 1 clone clone      13262 2009-10-14 20:18 Info-dmi.txt
    -rw-rw---- 1 clone clone      16877 2009-10-14 20:18 Info-lshw.txt
    -rw-rw---- 1 clone clone        285 2009-10-14 20:18 Info-packages.txt
    -rw-rw---- 1 clone clone         10 2009-10-14 20:18 parts
    charles@thor:/array/clone/Osiris_Windows7RC$
    Backup:

    Code:
    charles@thor:/array/clone/Osiris_Windows7RC$ ls -l /sync/clone/Osiris_Windows7RC
    total 5052060
    -rw-rw---- 1 charles clone          4 2009-10-14 20:18 disk
    -rw-rw---- 1 charles clone    8971058 2009-10-10 20:26 hda1.ntfs-ptcl-img.gz.aa
    -rw-rw---- 1 charles clone 2097152000 2009-10-10 20:34 hda2.ntfs-ptcl-img.gz.aa
    -rw-rw---- 1 charles clone 2097152000 2009-10-10 20:41 hda2.ntfs-ptcl-img.gz.ab
    -rw-rw---- 1 charles clone  963849232 2009-10-10 20:45 hda2.ntfs-ptcl-img.gz.ac
    -rw-rw---- 1 charles clone         37 2009-10-14 20:05 hda-chs.sf
    -rw-rw---- 1 charles clone    1048064 2009-10-14 20:05 hda-hidden-data-after-mbr
    -rw-rw---- 1 charles clone        512 2009-10-14 20:05 hda-mbr
    -rw-rw---- 1 charles clone        323 2009-10-14 20:05 hda-pt.parted
    -rw-r----- 1 charles clone          0 2009-10-14 20:05 hda-pt.sf
    -rw-rw---- 1 charles clone      13262 2009-10-14 20:18 Info-dmi.txt
    -rw-rw---- 1 charles clone      16877 2009-10-14 20:18 Info-lshw.txt
    -rw-rw---- 1 charles clone        285 2009-10-14 20:18 Info-packages.txt
    -rw-rw---- 1 charles clone         10 2009-10-14 20:18 parts
    Is there any way to track down why it's changing the owner?

    EDIT: So far only the clone folder is the one with the permissions changing. Other then that, the permissions are fine minus the owner.

    EDIT2: Looks like the -o option only works as superuser aka root. That must be why the owner is changing.
    Last edited by CharlesA; October 17th, 2009 at 05:38 PM.

  6. #26
    Join Date
    Apr 2009
    Beans
    1,173

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by CharlesA View Post
    How would I check for those?
    Code:
    charles@thor:/array/clone/Osiris_Windows7RC$ ls -l -rw-rw---- 1 charles clone    8971058 2009-10-10 20:26 hda1.ntfs-ptcl-img.gz.aa
    -rw-rw---- 1 charles clone 2097152000 2009-10-10 20:34 hda2.ntfs-ptcl-img.gz.aa
    -rw-rw---- 1 charles clone 2097152000 2009-10-10 20:41 hda2.ntfs-ptcl-img.gz.ab
    -rw-rw---- 1 charles clone  963849232 2009-10-10 20:45 hda2.ntfs-ptcl-img.gz.ac
    These four directories in the backup are newer than the source. The most likely issue is the ownership of the source, the destination and the user running rsync do not match. How do you have the partitions mounted?

    The commands mount and ls -ld <mountpoint> (where <> contains the path to your mountpoint) should tell you all you need.

  7. #27
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by StuartN View Post
    These four directories in the backup are newer than the source. The most likely issue is the ownership of the source, the destination and the user running rsync do not match. How do you have the partitions mounted?

    The commands mount and ls -ld <mountpoint> (where <> contains the path to your mountpoint) should tell you all you need.
    Thanks. Here's what I get when I run ls -ld /array:

    Code:
    charles@thor:/$ ls -ld /array
    drwxr-xr-x 14 charles charles 4096 2009-10-11 02:37 /array
    and ls-ld /sync:

    Code:
    charles@thor:/$ ls -ld /sync
    drwxrwxr-x 13 charles charles 4096 2009-10-11 03:00 /sync
    The owner is the same one that is doing the rsync.

    The results for those two mount points in mount is this:
    Code:
    /dev/sdb1 on /array type ext3 (rw)
    /dev/sdc1 on /sync type ext3 (rw)
    Since the group doesn't have write access on /array, is that what is causing the problem?

    Thanks!

  8. #28
    Join Date
    Jul 2006
    Beans
    4,681

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by StuartN View Post
    Cron runs as root. There is no reason why, in a properly mounted set of filesystems, the ownership would change. If you look then you will probably find you have lost file timestamps too.
    No, it does not, unless you specify to run as root.

    I know this because I use cron with rsync, and it runs as user "jason" (me) and does not transfer all group ownerships and everything else as the full -a switch does.

    I forgot how many functions -a has, but without running -a as root, you're not maximizing it for everything it's capable of.

    Question - When using -a without root priviledges, do the permissions themselves get carried over, and just not the group ownerships?

    EDIT - Another Question - I have a group set up called sambashare, where I added myself + all other users to the group simply so on my machine here, I can access their files if need be. They on the other hand do not need to access each others files, despite them all being in the sambashare group and sambashare being the group assigned to the samba network shares. So technically, on my machine, they could log in as themselves and get to everybody's stuff. But Samba permissions on each share prevents them from opening the shares, so that's okay there.

    Question is, being that the only reason I have the group in place is so I (jason) can hit all of the shares on my drives, would it make more sense to just assign jason as the group to each share? Because I have the shares owned by the user who utilizes them, but of course I have the group assigned too... aka... fred:sambashare. With each user, there's a group that exists with the same name, right? Should I just assign fred:jason instead of fred:sambashare? I'd get the same results, wouldn't I?
    Last edited by Roasted; October 17th, 2009 at 06:17 PM.

  9. #29
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Rsync - What's YOUR setup like?

    Quote Originally Posted by Roasted View Post
    Question - When using -a without root priviledges, do the permissions themselves get carried over, and just not the group ownerships?
    When I checked the permissions, they were correct outside of the "clone" folder but I'm still not sure why those perms are screwed up.

    Basically to run rsync as root with cron would look something like this, right?

    Code:
    * * * * * root rsync -a /array/* /sync
    EDIT:

    Quote Originally Posted by Roasted View Post
    Question is, being that the only reason I have the group in place is so I (jason) can hit all of the shares on my drives, would it make more sense to just assign jason as the group to each share? Because I have the shares owned by the user who utilizes them, but of course I have the group assigned too... aka... fred:sambashare. With each user, there's a group that exists with the same name, right? Should I just assign fred:jason instead of fred:sambashare? I'd get the same results, wouldn't I?
    Each user has a group created for them, yes. I believe that's how I have mine set up. me (charles) is a member of the other user's groups as well, so I have the same access as they do.
    Last edited by CharlesA; October 17th, 2009 at 06:25 PM.

  10. #30
    scouser73's Avatar
    scouser73 is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Mar 2008
    Location
    Liverpool, United Kingdom
    Beans
    1,664
    Distro
    Ubuntu 14.04 Trusty Tahr

    Wink Re: Rsync - What's YOUR setup like?

    For backing up I use Pybackpack, the tutorial shows you how to use it and in my opinion I think it's an excellent program for backing up data.

Page 3 of 7 FirstFirst 12345 ... LastLast

Tags for this Thread

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
  •