1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/flarum_ynh.git synced 2024-09-03 18:36:24 +02:00
flarum_ynh/scripts/backup
polytan02 ee9bcedbe0 Typo
2017-02-22 15:24:00 +00:00

39 lines
1 KiB
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Backup sources & data
# Note: the last argument is where to save this path, see the restore script.
ynh_backup "/var/www/${app}" "sources"
# Backup of composer
#
# TO BE VALIDATED AND TESTED
ynh_backup "/opt/flarum_composer" "flarum_composer"
ynh_backup "/usr/local/bin/composer" "local_composer"
### MySQL ###
# If a MySQL database is used:
# # Dump the database
dbname=$app
dbuser=$app
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./dump.sql
### MySQL end ###
# Copy NGINX configuration
domain=$(ynh_app_setting_get "$app" domain)
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
### PHP (remove if not used) ###
# If a dedicated php-fpm process is used:
# # Copy PHP-FPM pool configuration
ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"
### PHP end ###