|
|
@ -19,7 +19,7 @@ ynh_abort_if_errors |
|
|
#================================================= |
|
|
#================================================= |
|
|
# LOAD SETTINGS |
|
|
# LOAD SETTINGS |
|
|
#================================================= |
|
|
#================================================= |
|
|
ynh_script_progression --message="Loading installation settings..." --weight=2 |
|
|
|
|
|
|
|
|
ynh_print_info --message="Loading installation settings..." |
|
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME |
|
|
app=$YNH_APP_INSTANCE_NAME |
|
|
|
|
|
|
|
|
@ -29,41 +29,38 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) |
|
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) |
|
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) |
|
|
|
|
|
|
|
|
#================================================= |
|
|
#================================================= |
|
|
# 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 |
|
|
# BACKUP THE APP MAIN DIR |
|
|
#================================================= |
|
|
#================================================= |
|
|
ynh_script_progression --message="Backing up the main app directory..." --weight=2 |
|
|
|
|
|
|
|
|
|
|
|
CHECK_SIZE "$final_path" |
|
|
|
|
|
ynh_backup --src_path="$final_path" |
|
|
ynh_backup --src_path="$final_path" |
|
|
|
|
|
|
|
|
#================================================= |
|
|
#================================================= |
|
|
# BACKUP NGINX CONFIGURATION |
|
|
# BACKUP NGINX CONFIGURATION |
|
|
#================================================= |
|
|
#================================================= |
|
|
ynh_script_progression --message="Backing up nginx web server configuration..." |
|
|
|
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" |
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" |
|
|
|
|
|
|
|
|
#================================================= |
|
|
#================================================= |
|
|
# BACKUP PHP-FPM CONFIGURATION |
|
|
# BACKUP PHP-FPM CONFIGURATION |
|
|
#================================================= |
|
|
#================================================= |
|
|
ynh_script_progression --message="Backing up php-fpm configuration..." |
|
|
|
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" |
|
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" |
|
|
|
|
|
|
|
|
#================================================= |
|
|
#================================================= |
|
|
# BACKUP THE MYSQL DATABASE |
|
|
# BACKUP THE MYSQL DATABASE |
|
|
#================================================= |
|
|
#================================================= |
|
|
ynh_script_progression --message="Backing up the MySQL database..." --weight=2 |
|
|
|
|
|
|
|
|
ynh_print_info --message="Backing up the MySQL database..." |
|
|
|
|
|
|
|
|
ynh_mysql_dump_db --database="$db_name" > db.sql |
|
|
ynh_mysql_dump_db --database="$db_name" > db.sql |
|
|
CHECK_SIZE "db.sql" |
|
|
|
|
|
|
|
|
|
|
|
#================================================= |
|
|
#================================================= |
|
|
# BACKUP FAIL2BAN CONFIGURATION |
|
|
# BACKUP FAIL2BAN CONFIGURATION |
|
|
#================================================= |
|
|
#================================================= |
|
|
ynh_script_progression --message="Backing up fail2ban configuration..." |
|
|
|
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" |
|
|
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" |
|
|
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" |
|
|
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" |
|
|
@ -78,4 +75,4 @@ ynh_backup "/etc/cron.d/$app" |
|
|
# END OF SCRIPT |
|
|
# END OF SCRIPT |
|
|
#================================================= |
|
|
#================================================= |
|
|
|
|
|
|
|
|
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last |
|
|
|
|
|
|
|
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." |