1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00
gogs_ynh/scripts/backup

38 lines
921 B
Text
Raw Normal View History

2016-08-15 15:38:50 +02:00
#!/bin/bash
2018-02-08 17:25:54 +01:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
source /usr/share/yunohost/helpers
2016-08-15 15:38:50 +02:00
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
2016-08-15 15:38:50 +02:00
# Load common variables and helpers
2018-02-07 23:49:32 +01:00
source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh
2016-08-15 15:38:50 +02:00
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
2018-02-08 17:25:54 +01:00
#=================================================
# STANDARD BACKUP STEPS
#=================================================
2016-08-15 15:38:50 +02:00
# Copy the app source files
2018-02-07 23:49:32 +01:00
ynh_backup "$final_path"
2016-08-15 15:38:50 +02:00
# Copy the data files
ynh_backup "$DATADIR"
2016-08-15 15:38:50 +02:00
# Copy the conf files
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf"
ynh_backup "/etc/systemd/system/${app}.service"
2016-08-15 15:38:50 +02:00
2018-02-08 11:42:15 +01:00
# Backup logs
ynh_backup "/var/log/$app"
2016-08-15 15:38:50 +02:00
# Dump the database
2018-02-08 17:25:54 +01:00
ynh_mysql_dump_db "$dbname" > ./db.sql