Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # backup
- BACKUP_DIR='/mnt/backup'
- if df | grep -q "${BACKUP_DIR}"; then
- # shellcheck disable=SC3009
- rsync -aAXHv --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / "$BACKUP_DIR"
- else printf '%s\n' "${BACKUP_DIR} is not a mount point. Not backing up."
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement