Clarify source and destination input parameters
Add prompt after input check Allow user to double check their input by waiting for their action after printing information of
This commit is contained in:
parent
6947a63fe3
commit
86c20d84b4
1 changed files with 10 additions and 2 deletions
12
backup.sh
12
backup.sh
|
|
@ -10,8 +10,16 @@ empty_dir=$(mktemp -d)
|
||||||
BACKUP_LOCATION="${BACKUP_LOCATION}-$(date +'%Y-%m-%d').sqsh"
|
BACKUP_LOCATION="${BACKUP_LOCATION}-$(date +'%Y-%m-%d').sqsh"
|
||||||
CHECKSUM_FILE="$DEVICE_NAME.img.cksum"
|
CHECKSUM_FILE="$DEVICE_NAME.img.cksum"
|
||||||
|
|
||||||
echo Backup: $DRIVE_TO_BACKUP
|
echo
|
||||||
echo To: $BACKUP_LOCATION
|
echo Backup source: $DRIVE_TO_BACKUP
|
||||||
|
echo Backup destination: $BACKUP_LOCATION
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo Check if your input is correct
|
||||||
|
echo Double check the correct usage of source and destination
|
||||||
|
echo \"Backup source\" is the drive you want to backup
|
||||||
|
echo \"Backup destination\" is where the backup will be stored
|
||||||
|
read -n1 -r -s -p $"Press space to continue..."
|
||||||
|
|
||||||
mksquashfs $empty_dir $BACKUP_LOCATION -p "$DEVICE_NAME.img f 444 root root dd if=$DRIVE_TO_BACKUP bs=4M" -p "$CHECKSUM_FILE f 444 root root dd if=$DRIVE_TO_BACKUP | cksum"
|
mksquashfs $empty_dir $BACKUP_LOCATION -p "$DEVICE_NAME.img f 444 root root dd if=$DRIVE_TO_BACKUP bs=4M" -p "$CHECKSUM_FILE f 444 root root dd if=$DRIVE_TO_BACKUP | cksum"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue