Skip to content

Commit a3177e8

Browse files
authored
Merge pull request #199 from quorn23/master
2 parents f82ee12 + 8e16a79 commit a3177e8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

extra-scripts/backup_appdata.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ create_backup() {
182182
# Create the backup file name
183183
backup_file="$(realpath -s "$destination_dir")/$(date +%F)@$now/$container_name"
184184
# Go to the source directory
185+
# Check if source_dir is a directory, if not, strip the filename
186+
if [ ! -d "$source_dir" ]; then
187+
source_dir=$(dirname "$source_dir")
188+
fi
185189
cd "$source_dir"/.. || return
186190
# Get the name of the source directory
187191
source_dir=$(basename "$source_dir")
@@ -980,4 +984,4 @@ main() {
980984
fi
981985
}
982986

983-
main
987+
main

0 commit comments

Comments
 (0)