mirror of
https://github.com/YunoHost-Apps/gogs_ynh.git
synced 2024-09-03 20:36:23 +02:00
fix
This commit is contained in:
parent
1390568de3
commit
a62b96d9e5
3 changed files with 48 additions and 16 deletions
|
@ -14,7 +14,6 @@
|
||||||
upgrade=1
|
upgrade=1
|
||||||
upgrade=1 from_commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab
|
upgrade=1 from_commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab
|
||||||
upgrade=1 from_commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5
|
upgrade=1 from_commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5
|
||||||
upgrade=1 from_commit=5a706ed246392c1ce39c47a648cb93e2996e80d3
|
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=0
|
incorrect_path=0
|
||||||
|
@ -37,5 +36,3 @@
|
||||||
name=Before multi_instance and refactoring
|
name=Before multi_instance and refactoring
|
||||||
; commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5
|
; commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5
|
||||||
name=From V0.10.18
|
name=From V0.10.18
|
||||||
; commit=5a706ed246392c1ce39c47a648cb93e2996e80d3
|
|
||||||
name=The oldest package
|
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Is it a public site ?",
|
"en": "Is it a public site?",
|
||||||
"fr": "Est-ce un site public ?"
|
"fr": "Est-ce un site public ?"
|
||||||
},
|
},
|
||||||
"default": true
|
"default": true
|
||||||
|
|
|
@ -3,35 +3,70 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC START
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Exit if an error occurs during the execution of the script
|
#=================================================
|
||||||
|
# MANAGE SCRIPT FAILURE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
# Load common variables and helpers
|
#=================================================
|
||||||
source ../settings/scripts/_common.sh
|
# LOAD SETTINGS
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info --message="Loading installation settings..."
|
||||||
|
|
||||||
# Retrieve app settings
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
|
||||||
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD BACKUP STEPS
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Copy the app source files
|
|
||||||
ynh_backup "$final_path"
|
ynh_backup "$final_path"
|
||||||
|
|
||||||
# Copy the data files
|
# Copy the data files
|
||||||
ynh_backup "$DATADIR"
|
ynh_backup "$DATADIR"
|
||||||
|
|
||||||
# Copy the conf files
|
#=================================================
|
||||||
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP SYSTEMD
|
||||||
|
#=================================================
|
||||||
|
|
||||||
ynh_backup "/etc/systemd/system/${app}.service"
|
ynh_backup "/etc/systemd/system/${app}.service"
|
||||||
|
|
||||||
# Backup logs
|
#=================================================
|
||||||
|
# BACKUP VARIOUS FILES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
ynh_backup "/var/log/$app"
|
ynh_backup "/var/log/$app"
|
||||||
|
|
||||||
# Dump the database
|
#=================================================
|
||||||
ynh_mysql_dump_db "$dbname" > ./db.sql
|
# BACKUP THE MYSQL DATABASE
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info --message="Backing up the MySQL database..."
|
||||||
|
|
||||||
|
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||||
|
|
Loading…
Reference in a new issue