1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/scrumblr_ynh.git synced 2024-09-03 20:16:29 +02:00

add db backup

This commit is contained in:
root 2022-01-11 15:58:41 +00:00 committed by Tobias Ollive
parent 756c60e789
commit 4c9e2c65b9

View file

@ -62,6 +62,11 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
if $(ynh_compare_current_package_version --comparison gt --version "0.2.0~ynh1")
then
# save redis db
pushd $final_path
redis-cli --rdb "/tmp/redis-$app.rdb" -p $redis_port
popd
ynh_systemd_action --service_name=redis-$app --action="stop" --log_path="/var/log/$app/redis-$app.log"
fi
#=================================================
@ -97,10 +102,16 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
ynh_secure_remove --file="$final_path"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
# restore db backup
if $(ynh_compare_current_package_version --comparison gt --version "0.2.0~ynh1")
then
mv /tmp/redis-$app.rdb $final_path/redis-$app.rdb
fi
fi
if [ "$upgrade_type" == "UPGRADE_APP" ]
@ -139,7 +150,7 @@ ynh_add_systemd_config --service $redis_service --template "scrumblr_redis.servi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:redis "$final_path"
chown -R $app:$app "$final_path"
#=================================================