File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ p_all=${p_all=0}
277
277
[[ -z $p_dest ]] && error " No path specified!"
278
278
279
279
function exit-msg {
280
+ # shellcheck disable=SC2317
280
281
notify-send -u critical " Done backing up $p_config . Safe to turn off computer."
281
282
}
282
283
@@ -517,7 +518,7 @@ function backup {
517
518
if [[ " ${# common[@]} " == 0 ]]
518
519
then
519
520
echo " Initialize backup"
520
- if [ $p_all -eq 1 ]
521
+ if [ " $p_all " -eq 1 ]
521
522
then
522
523
# Send the first snapshot as a whole then the rest will be
523
524
# sent incremental.
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ case "$1" in
31
31
version) # Return what version of the API it's using, always one integer
32
32
echo 2
33
33
;;
34
- list-snapshots) # List snapshots at backup location
34
+ list-snapshots) # List snapshots at src/dest location
35
35
shift
36
- find " $1 " -mindepth 1 -maxdepth 1 -type d -printf " %f\n" | sort -g
36
+ find " $1 " -mindepth 1 -maxdepth 1 -type d -printf " %f\n" | sort -g | xargs -I{} sh -c ' btrfs prop get "/.snapshots/{}/snapshot" ro | grep -q true && echo {} '
37
37
;;
38
38
get-snapper-root) # Return the location of the .snapshots directory
39
39
shift
@@ -121,6 +121,7 @@ case "$1" in
121
121
error " $1 /latest exists and is not a symbolic link. Link is not created."
122
122
fi
123
123
fi
124
+ # shellcheck disable=SC2045
124
125
for dir in $( ls -d1v " $1 " /* ) ; do
125
126
if [[ -d " $dir /snapshot" && ! -h " $dir " ]]; then
126
127
snapshots+=(" $dir " )
You can’t perform that action at this time.
0 commit comments