projects
/
rrq
/
nilfs2sss.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0deeb58
)
use /backup as default
author
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Tue, 9 Nov 2021 22:50:06 +0000
(09:50 +1100)
committer
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Tue, 9 Nov 2021 22:50:06 +0000
(09:50 +1100)
ssbrowse.sh
patch
|
blob
|
history
diff --git
a/ssbrowse.sh
b/ssbrowse.sh
index 82a7b374e33d428e31e1d45f829e662d300b148b..d9c06b6feadd31d16c81ab584e1a9a8d647ac593 100755
(executable)
--- a/
ssbrowse.sh
+++ b/
ssbrowse.sh
@@
-2,8
+2,7
@@
#
# Browse snapshots of a given path and run meld to compare with
# current directory
#
# Browse snapshots of a given path and run meld to compare with
# current directory
-# $1: path -- into mounted nilfs
-# $2: [path] -- to compare with
+# $1: path -- for mounted nilfs
## Prepare for mounting of snapshots
MOUNT=/tmp/ssmeld-$$
## Prepare for mounting of snapshots
MOUNT=/tmp/ssmeld-$$
@@
-11,18
+10,19
@@
mkdir -p $MOUNT || exit 1
function exitbrowse() {
umount $MOUNT 2>/dev/null
function exitbrowse() {
umount $MOUNT 2>/dev/null
- rmdir
-f
$MOUNT
+ rmdir $MOUNT
trap "" 0
}
trap "exitbrowse" 0 2 9 15
trap "" 0
}
trap "exitbrowse" 0 2 9 15
-DF=( $(df $1 | awk '{d=$1;p=$NF;} END {printf "%s %s", d, p;}') )
+ARG1="${1-/backup}"
+DF=( $(df $ARG1 | awk '{d=$1;p=$NF;} END {printf "%s %s", d, p;}') )
-NILFSROOT=
${DF[1]}
-NILFSDEV=
${DF[0]}
-PTR="${1#$NILFSROOT}"
-DIR0=
$MOUNT$PTR
-DIR1=
$NILFSROOT
+NILFSROOT=
"${DF[1]}"
+NILFSDEV=
"${DF[0]}"
+PTR="${
ARG
1#$NILFSROOT}"
+DIR0=
"$MOUNT$PTR"
+DIR1=
"$NILFSROOT"
function snap2iselect() {
lscp -r -s $NILFSDEV | while read CNO DATE TIME REST ; do
function snap2iselect() {
lscp -r -s $NILFSDEV | while read CNO DATE TIME REST ; do