Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ "$(id -u)" != "0" ]; then
- exec sudo "$0" "$@"
- fi
- backuplocation="/home/chugger/bigmedia/macrium reflect/acer2/linux"
- backupname="/home/chugger/bigmedia/macrium reflect/acer2/linux/`hostname`_linux_backup_`date '+%Y-%m-%d'`_.img.gz"
- user=$SUDO_USER
- bash -c "dd status=progress if=/dev/nvme1n1 | gzip > \"$backupname\" ; chown $user:$user \"$backupname\""
- # to restore... something like this:
- # gzip -d -c {backup.img.gz} | dd status=progress of={where}
Advertisement
Add Comment
Please, Sign In to add comment