Skip to content

Instantly share code, notes, and snippets.

@adamamyl
Created December 20, 2012 16:32
Show Gist options
  • Save adamamyl/4346500 to your computer and use it in GitHub Desktop.
Save adamamyl/4346500 to your computer and use it in GitHub Desktop.
rsync useful dirs from Mac ('hokey') -> removable disk
root@hokey:/# for D in `ls -lha | awk '/^d/ {print $NF}' | egrep -v '^(.Spotlight-V100|.Trashes|Volumes|dev)' | tail -n +3`; do echo "--------- Looking at ${D} -------"; rsync -vua /${D}/ /Volumes/Hokey-Backup/hokey-system/${D}/; done
# yes I could use awk instead of egrep.
# I prefer for() over while() for some reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment