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:
parent
756c60e789
commit
4c9e2c65b9
1 changed files with 13 additions and 2 deletions
|
@ -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"
|
||||
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue