2017-11-01 20:57:58 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2018-07-13 17:31:45 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2017-11-01 20:57:58 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MANAGE SCRIPT FAILURE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2019-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Load settings"
|
2017-11-01 20:57:58 +01:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD BACKUP STEPS
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE APP MAIN DIR
|
|
|
|
#=================================================
|
2019-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Backup the app main dir"
|
2017-11-01 20:57:58 +01:00
|
|
|
|
|
|
|
ynh_backup "$final_path"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC BACKUP
|
|
|
|
#=================================================
|
|
|
|
# BACKUP LOGROTATE
|
|
|
|
#=================================================
|
2019-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Backup logrotate configuration"
|
2017-11-01 20:57:58 +01:00
|
|
|
|
|
|
|
ynh_backup "/etc/logrotate.d/$app"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE CRON FILE
|
|
|
|
#=================================================
|
2019-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Backup cron file"
|
2017-11-01 20:57:58 +01:00
|
|
|
|
|
|
|
ynh_backup "/etc/cron.d/$app"
|
2019-01-30 16:07:38 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Backup completed" --last
|