Rsync help on OS X server

Discussion in 'Mac Basics and Help' started by carefree, Oct 6, 2015.

  1. carefree macrumors newbie

    Joined:
    Oct 6, 2015
    #1
    Hi All,

    Just looking for some advice on a strange issue that i seem to be having backing up my files on my mac server.

    I am using rsync to backup files on our shared drives to a network Nas, the main problem i am having is when i use this rsync command 'sudo rsync -av /source/ /destination/ the files copy ok. I then run the same command again with the 'n' command as well and its showing that its going to copy all the same files again. I really don't know why it is doing this. The strange thing is when i remove 'sudo' and run the command it only copies the files which have modified which is what i want.

    So my question is why does using 'sudo' force all the same files that have not been modified to be copied over to the destination again?

    Im fairly new to mac so i may be missing something no apologies if i am.

    Thanks all
     
  2. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #2
    I will go with the sudo being a different owner (root in this case) of the files so it is doing what it is supposed to do copy the files now owned by another user compared to the non sudo command. You should not need the sudo command for backup of your normal user owned files at all I see no sense in using it. Also the -n command switch is the same as --dry-run according to the man page so it should only be showing you what it will do not trying to copy anything.

    Code:
     -n, --dry-run  show what would have been transferred
    
    Oh and I see no mention of the --delete option being used so if you remove any files from the source then they are not being removed on the destination drive thus wasting space for files you have already deleted.
     

Share This Page