1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/outline_ynh.git synced 2024-09-03 19:56:12 +02:00

Backup start

This commit is contained in:
Limezy 2021-11-11 22:03:50 +07:00
parent 497912f9d5
commit 0413924532
2 changed files with 14 additions and 21 deletions

View file

@ -30,9 +30,16 @@ 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)
path_url=$(ynh_app_setting_get --app=$app --key=path_url)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
language_key=$(ynh_app_setting_get --app=$app --key=language_key)
slack_key=$(ynh_app_setting_get --app=$app --key=slack_key)
slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret)
minio_domain=$(ynh_app_setting_get --app="minio" --key=domain)
minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id)
minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key)
mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@ -51,10 +58,10 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE DATA DIR
# BACKUP MINIO
#=================================================
ynh_backup --src_path="$datadir" --is_big
sudo yunohost backup create --apps minio
#=================================================
# BACKUP THE NGINX CONFIGURATION
@ -62,12 +69,6 @@ ynh_backup --src_path="$datadir" --is_big
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# BACKUP FAIL2BAN CONFIGURATION
#=================================================
@ -90,15 +91,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/etc/cron.d/$app"
ynh_backup --src_path="/etc/$app/"
#=================================================
# BACKUP THE MYSQL DATABASE
# BACKUP THE POSTGRE DATABASE
#=================================================
ynh_print_info --message="Backing up the MySQL database..."

View file

@ -38,8 +38,8 @@ else
echo "English"
fi
secret_key=`openssl rand -hex 32`
utils_secret=`openssl rand -hex 32`
secret_key=$(ynh_string_random --length=32)
utils_secret=$(ynh_string_random --length=32)
slack_key=$YNH_APP_ARG_SLACK_KEY
slack_secret=$YNH_APP_ARG_SLACK_SECRET