-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathz
More file actions
29 lines (22 loc) · 598 Bytes
/
Copy pathz
File metadata and controls
29 lines (22 loc) · 598 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
set -e
MYFISH="$HOME/MyFish"
BACKUPS="$MYFISH/backups"
command -v zenity >/dev/null || {
echo "Zenity not installed"; exit 1
}
ARCHIVE=$(zenity --file-selection \
--title="Select MyFish Backup" \
--filename="$BACKUPS/" \
--file-filter="*.tar.gz")
[ -z "$ARCHIVE" ] && exit 0
zenity --text-info \
--title="Backup Preview" \
--width=700 --height=500 \
--filename=<(tar -tzf "$ARCHIVE" | head -n 50)
zenity --question \
--text="Restore this backup to HOME?"
if [ $? -eq 0 ]; then
tar -xzf "$ARCHIVE" -C "$HOME"
zenity --info --text="Restore complete"
fi