Last active
December 26, 2015 01:19
-
-
Save marek-saji/7070220 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Backup files specified in ~saji/.config/backup-these | |
| # (c) Marek `saji' Augustynowicz | |
| if [ "$EUID" != "0" ] | |
| then | |
| echo "Run as root, yo." | |
| exit 1 | |
| fi | |
| DIR="$( dirname "$0" )/$HOSTNAME" | |
| mkdir -p "$DIR" | |
| cd "$DIR" | |
| pwd | |
| # -R use relative path names (will create whole path under current dir, | |
| # not just use dirname) | |
| # -a archive mode | |
| # -p preserve permissions | |
| # -v verbose | |
| # -u update: copy only never files | |
| # --progress display progress | |
| cat ~saji/.config/backup-these | xargs -I '{}' \ | |
| rsync -Rapvu --progress '{}' ./ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment