Add backup core only

This commit is contained in:
Rafi59
2019-02-22 21:48:50 +01:00
parent ef962d9560
commit c788865334
3 changed files with 56 additions and 4 deletions

View File

@ -35,4 +35,18 @@ ynh_backup "/etc/systemd/system/${app}.service"
ynh_backup "/var/log/$app"
# Dump the database
ynh_mysql_dump_db "$dbname" > ./db.sql
ynh_mysql_dump_db "$dbname" > ./db.sql
#=================================================
# BACKUP THE DATA DIRECTORY
#=================================================
backup_core_only=$(ynh_app_setting_get "$app" backup_core_only)
# If backup_core_only have any value in the settings.yml file, do not backup the data directory
if [ -z $backup_core_only ]
then
ynh_backup "/home/$app"
else
echo "Data dir will not be saved, because backup_core_only is set." >&2
fi