mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
Apply last example_ynh on backup script
This commit is contained in:
parent
0c4121ac52
commit
117393a2f5
1 changed files with 18 additions and 37 deletions
|
@ -33,30 +33,38 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD BACKUP STEPS
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Stopping a systemd service..." --weight=27
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=systemd --line_match="Stopped"
|
|
||||||
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=systemd --line_match="Stopped"
|
|
||||||
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=systemd --line_match="Stopped"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up the main app directory..." --weight=2
|
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up nginx web server configuration..." --weight=2
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC BACKUP
|
||||||
|
#=================================================
|
||||||
|
# BACKUP SYSTEMD
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/etc/systemd/system/$app-web.service"
|
||||||
|
ynh_backup --src_path="/etc/systemd/system/$app-sidekiq.service"
|
||||||
|
ynh_backup --src_path="/etc/systemd/system/$app-streaming.service"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP A CRON FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE POSTGRESQL DATABASE
|
# BACKUP THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -64,33 +72,6 @@ ynh_script_progression --message="Backing up the PostgreSQL database..." --weigh
|
||||||
|
|
||||||
ynh_psql_dump_db --database="$db_name" > db.sql
|
ynh_psql_dump_db --database="$db_name" > db.sql
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC BACKUP
|
|
||||||
#=================================================
|
|
||||||
# BACKUP SYSTEMD
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Backing up systemd configuration..." --weight=2
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app-web.service"
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app-sidekiq.service"
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app-streaming.service"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP A CRON FILE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Backing up a cron file..." --weight=1
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/cron.d/$app"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# START SYSTEMD SERVICE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --action=start --service_name=${app}-web --line_match="Listening on tcp" --log_path=systemd
|
|
||||||
ynh_systemd_action --action=start --service_name=${app}-sidekiq --line_match="Starting processing" --log_path=systemd
|
|
||||||
ynh_systemd_action --action=start --service_name=${app}-streaming --line_match="Worker 1 now listening" --log_path=systemd
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue