Developing lightweight computation at the DSG edge

Commit 77cdb784 authored by p4u's avatar p4u
Browse files

Upgrade checks if the preserve files and directories exists before adding it to tar

parent f4ef3181
......@@ -101,8 +101,15 @@ qmp_update_check() {
}
qmp_update_save_config() {
local d
local preserve=""
# Checking if the preserve files/directory exist
for d in $@; do
[ -e "$d" ] && preserve="$preserve $d"
done
cd /
tar czf /tmp/qmp_saved_config.tar.gz $@
tar czf /tmp/qmp_saved_config.tar.gz $preserve
[ $? -ne 0 ] && qmp_error "Cannot save config: $@"
echo "/tmp/qmp_saved_config.tar.gz"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment