1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00
pleroma_ynh/scripts/backup
yalh76 ca57261147 Fix Avatar Change and install error (#56)
* remove not needed variable

* fix uploads folder not available

* remove not needed --force for ecto.migrate

* Cleanup

* Update check_process

* Update check_process

* add ynh_add_secure_repos__2

* Fix version

* fix source

* Update install

* Update install

* Update remove

* Update _common.sh

* fix version

* Update install

* Update install

* Update install

* Update install

* Update remove

* Update restore

* fix repo

* Update check_process

* Update install

* fix yn,h_install_extra_repo

* fix extra repo

* Update install

* remove ynh_add_secure_repos__2

* removing erlang-inets dependency

* Delete ynh_add_secure_repos__2

* Adding ynh_add_secure_repos__2

* fix asc

* remove ynh_add_secure_repos__2

* Update upgrade

* Update install

* Fix repository

* Bask to erlang-solutions.list

* activate check_url

* spacing

* Update check_process
2019-03-29 12:42:45 +01:00

90 lines
2.7 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh
source ../settings/scripts/ynh_systemd_action
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info "Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path)
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name)
cache=$(ynh_app_setting_get "$app" cache)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_print_info "Backing up the main app directory..."
ynh_backup "$final_path"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_print_info "Backing up nginx web server configuration..."
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
if [ $cache -eq 1 ]
then
ynh_backup "/etc/nginx/conf.d/$app-cache.conf"
fi
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_print_info "Backing up php-fpm configuration..."
#ynh_backup "/etc/php/7.0/fpm/pool.d/$app.conf"
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
ynh_print_info "Backing up the PostgreSQL database..."
ynh_psql_dump_db "$db_name" > db.sql
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_print_info "Backing up logrotate configuration..."
ynh_backup "/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_print_info "Backing up systemd configuration..."
ynh_backup "/etc/systemd/system/$app.service"
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."