Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- device=97102854-980f-44c8-8c6a-a47d1acea6a9
- mount_device () {
- if [ $1 == mount ];then
- mount UUID=$device /mnt/backup
- /root/mount_win.sh
- elif [ $1 == umount ];then
- umount /mnt/backup
- umount /mnt/windows
- fi
- }
- case $1 in
- poweroff)
- mount_device mount
- rsnapshot daily
- sleep 60
- mount_device umount
- init 0
- ;;
- restore)
- mount_device mount
- ;;
- backup)
- mount_device mount
- rsnapshot daily
- sleep 60
- mount_device umount
- ;;
- *)
- echo ""
- echo "$0 <poweroff|backup|restore>"
- echo ""
- echo "poweroff: backup and shutdown system"
- echo "backup: only backup"
- echo "mount: mount backup device to restore files"
- echo""
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement