diff --git a/check_process b/check_process index 14429cb..e03f6ef 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,6 @@ upgrade=1 upgrade=1 from_commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab upgrade=1 from_commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 - upgrade=1 from_commit=5a706ed246392c1ce39c47a648cb93e2996e80d3 backup_restore=1 multi_instance=1 incorrect_path=0 @@ -37,5 +36,3 @@ name=Before multi_instance and refactoring ; commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 name=From V0.10.18 - ; commit=5a706ed246392c1ce39c47a648cb93e2996e80d3 - name=The oldest package diff --git a/manifest.json b/manifest.json index 9a365df..0994575 100644 --- a/manifest.json +++ b/manifest.json @@ -59,7 +59,7 @@ "name": "is_public", "type": "boolean", "ask": { - "en": "Is it a public site ?", + "en": "Is it a public site?", "fr": "Est-ce un site public ?" }, "default": true diff --git a/scripts/backup b/scripts/backup index 01a0761..318a30c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -3,35 +3,70 @@ #================================================= # GENERIC START #================================================= - # IMPORT GENERIC HELPERS +#================================================= + +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -# Exit if an error occurs during the execution of the script +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + 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 -domain=$(ynh_app_setting_get "$app" domain) +app=$YNH_APP_INSTANCE_NAME + +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" # Copy the data files ynh_backup "$DATADIR" -# Copy the conf files +#================================================= +# BACKUP THE NGINX CONFIGURATION +#================================================= + ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" + +#================================================= +# BACKUP SYSTEMD +#================================================= + ynh_backup "/etc/systemd/system/${app}.service" -# Backup logs +#================================================= +# BACKUP VARIOUS FILES +#================================================= + ynh_backup "/var/log/$app" -# Dump the database -ynh_mysql_dump_db "$dbname" > ./db.sql \ No newline at end of file +#================================================= +# 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)."