April 23, 201411 yr Hi, Does anyone here use Rsync to keep folders on separate macs in sync? I want to back some folders on my Mac mini to an external drive on my wife's mac book I would also like to back up my wife's photo library to a folder on an external drive on my Mac mini I would appreciate any advice or pointers to some good websites Thanks in advance
April 23, 201411 yr rsync -avx --progress /original/location/Documents/ /Volumes/mountpointofbackupdisk/DataBackup/ quite straight forward.write that in a sh file .. and create a applescript, then you will have a cute icon to click on and you not have to type it always again
April 23, 201411 yr I would also use the -X option for extended attributes (if they are used on Mac) After a first backup, you can make full backup in an incremental way. Make a hard linked copy of the old backup (it is very fast) and use rsync on top of that. I don't know the differences between Mac and linux, but maybe you can use my script in some way: #!/usr/bin/shMOUNT_T=`lsblk|grep /mnt`if test -z "${MOUNT_T}"; then (echo "Cannot mount, /mnt already mounted" && exit); fimount -L "backup" /mnt || (echo -e "\nMount failed! Wrong disk/label?" && exit)# Disks used for backup must have label "backup"RECENT=`ls -A /mnt/backup|grep -e "^[0-9]"|sort|tail -1`NEW=`date +%y%m%d:%H%M%S`;echo $RECENT $NEWif test -z $RECENT; then mkdir -p /mnt/backup/${NEW}/localhost;else cp -al /mnt/backup/$RECENT /mnt/backup/${NEW}/; fiif test -z $RECENT; then mkdir -p /mnt/backup/${NEW}/localhost;else cp -al /mnt/backup/$RECENT /mnt/backup/${NEW}/; firsync -aXxv --delete --relative --delete-excluded \ /bin \ /boot \ /.config \ /etc \ /home --exclude=/home/user/.thumbnails/* --exclude=/home/user/.kde4/share/apps/nepomuk/* \ --exclude=/home/archlinux/* --exclude=/home/user/.cache/chromium/* --exclude=/home/user/.ccache/* \ /lib \ /lib64 \ /opt \ /root --exclude=/root/.thumbnails/*/* --exclude=/root/.kde4/share/apps/nepomuk/* \ /sbin \ /usr \ /var --exclude=/var/log/ --exclude=/var/db/sudo/ --exclude=/var/tmp/ \ /mnt/backup/${NEW}/localhost/ && \ df -h && \ sync && \ du -csh /mnt/backup/* && \ sync && \ umount -v /mnt || echo -e '\nError backing up - or unmounting disk !!!!!!!!!!'
April 23, 201411 yr The formatting in the code box went terribly wrong. I can PM you if you want a more readable script
April 24, 201411 yr Author Thank you for the help guys - I may have some follow up questions if I get stuck
May 17, 201411 yr Would just use dropbox or similar these days rather than rsync. Yes rsync to the dropbox folder. Saves the trouble about mounting nfs and laggy os if they unavaiable.
Create an account or sign in to comment