Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -e
- set -x
- LABEL=Backup201803
- DEVICE=/dev/disk/by-label/${LABEL}
- MOUNTPOINT=/mnt/${LABEL}
- # first check to see if drive is present
- if [ ! -b ${DEVICE} ]
- then
- echo "external backup drive ${LABEL} not present"
- exit 1
- fi
- # mount it if needed
- if [ ! -d ${MOUNTPOINT}/backup/orifice ]
- then
- mount ${DEVICE} ${MOUNTPOINT}
- fi
- if [ ! -d ${MOUNTPOINT}/backup/orifice ]
- then
- echo "mount failed"
- exit 1
- fi
- # now backup to it
- time rsync -av --one-file-system / /mnt/${LABEL}/backup/orifice/
Add Comment
Please, Sign In to add comment