mirror of
https://github.com/YunoHost-Apps/penpot_ynh.git
synced 2024-09-03 19:56:56 +02:00
Fixed backup/restore/remove.
This commit is contained in:
parent
5db0cc74bc
commit
a793471f46
3 changed files with 19 additions and 18 deletions
|
@ -24,15 +24,15 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
|
||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||
|
||||
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||
ynh_backup --src_path="/etc/systemd/system/$app-backend.service"
|
||||
ynh_backup --src_path="/etc/systemd/system/$app-exporter.service"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE DATABASE
|
||||
# BACKUP THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
ynh_print_info --message="Backing up the postgresql database..."
|
||||
ynh_print_info --message="Backing up the PostgreSQL database..."
|
||||
|
||||
### (However, things like MySQL dumps *do* take some time to run, though the
|
||||
### copy of the generated dump to the archive still happens later)
|
||||
ynh_psql_dump_db --database="$db_name" > db.sql
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -34,7 +34,6 @@ ynh_remove_nginx_config
|
|||
|
||||
ynh_remove_logrotate
|
||||
|
||||
# Remove other various files specific to the app... such as :
|
||||
|
||||
ynh_secure_remove --file="/var/log/$app"
|
||||
|
||||
|
|
|
@ -17,7 +17,8 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
|||
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R $app:$app "$install_dir"
|
||||
chown -R $app:www-data "$install_dir/frontend"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE DATA DIRECTORY
|
||||
|
@ -26,11 +27,10 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1
|
|||
|
||||
ynh_restore_file --origin_path="$data_dir" --not_mandatory
|
||||
|
||||
# (Same as for install dir)
|
||||
chown -R $app:www-data "$data_dir"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
|
||||
|
@ -42,26 +42,28 @@ ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./d
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||
|
||||
# This should be a symetric version of what happens in the install script
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app-backend.service"
|
||||
systemctl enable $app-backend.service --quiet
|
||||
|
||||
yunohost service add $app --log="/var/log/$app/$app.log"
|
||||
yunohost service add $app-backend --log="/var/log/$app/$app-backend.log"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app-exporter.service"
|
||||
systemctl enable $app-exporter.service --quiet
|
||||
|
||||
yunohost service add $app-exporter --log="/var/log/$app/$app-exporter.log"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||
|
||||
# Other various files...
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
||||
|
||||
# Typically you only have either $app or php-fpm but not both at the same time...
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name=$app-backend --action="start" --log_path="/var/log/$app/$app-backend.log" --line_match="welcome to penpot"
|
||||
|
||||
ynh_systemd_action --service_name=$app-exporter --action="start" --log_path="/var/log/$app/$app-exporter.log" --line_match="redis connection established"
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue