1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00

Appy last example_ynh

This commit is contained in:
yalh76 2020-05-27 04:48:48 +02:00
parent b4c06bc4a8
commit 53cd71521d

View file

@ -35,27 +35,19 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
cache=$(ynh_app_setting_get --app=$app --key=cache)
#=================================================
# STANDARD BACKUP STEPS
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_print_info --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app"
pkill -u $app
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_print_info --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_print_info --message="Backing up nginx web server configuration..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -64,6 +56,20 @@ then
ynh_backup --src_path="/etc/nginx/conf.d/$app-cache.conf"
fi
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP CONFIG FILE
#=================================================
ynh_backup --src_path="/etc/$app/config.exs"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
@ -71,32 +77,6 @@ ynh_print_info --message="Backing up the PostgreSQL database..."
ynh_psql_dump_db --database="$db_name" > db.sql
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP CONFIG FILE
#=================================================
ynh_print_info --message="Backing up configuration file..."
ynh_backup --src_path="/etc/$app/config.exs"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_print_info --message="Backing up systemd configuration..."
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_print_info --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started $app"
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
sleep 60
fi
#=================================================
# END OF SCRIPT
#=================================================