Skip to content

Instantly share code, notes, and snippets.

@robot-o
Created June 20, 2017 05:41
Show Gist options
  • Save robot-o/417c83ea8e924ae45013ee8e6bebedf3 to your computer and use it in GitHub Desktop.
Save robot-o/417c83ea8e924ae45013ee8e6bebedf3 to your computer and use it in GitHub Desktop.
backup yo shit
#!/bin/sh
if [ -d "$1" ];
then
sudo rsync -aAXv --progress --exclude={"/files/*","/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/home/*/.cache/*","/home/*/Sync/*","/home/*/.mozilla/*"} / "$1";
else
echo $'usage:\n'$0' </path/to/target/directory>';
echo $'\nError: invalid target directory, cancelling backup..';
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment