requirements:

1. descend into subdirectories/recursive (-r)

2. show me whats beeing done (-vv –progress)

3. do NOT CREATE /WHERE/STUFF/SHOULD/GO/SUBPATH but rather integrate/merge files and folders (if ../GO/SUBPATH already exists)

[cc lang=”bash” escaped=”true” width=”600″]
# simple mirroring of two directories
# the SOURCEDIR/ has a trailing slash, the TARGETDIR has not, if you have SOURCEDIR/ TARGETDIR/ you end up with TARGETDIR/SOURCEDIR/ which you might not want
rsync -r -vv –progress ./A/ ./B
rsync -r -vv –progress /PATH/SUBPATH/ /WHERE/STUFF/SHOULD/SUBPATHMIRROR

# sync ext4 directory to NTFS external harddisk (modification date/time might be wrong/not possible to compare
# this will skip any already existing files on receiving side
echo “============== backup movies”
rsync -r -vv –update –progress –ignore-existing /media/usb0/MOVIES/ /media/usb0/MOVIES;

# backup system using rsync
rsync -aAXv –update /* /path/to/backup/folder –exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs}

# if you backup from linux→mac, leave out the -A switch:
rsync -aXv –update /* /path/to/backup/folder –exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs}

# linux knows option: -A, –acls preserve ACLs (implies -p)
# mac knows option: -E, –extended-attributes – Apple specific option to copy extended attributes, resource

[/cc]

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin