1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/minchat_ynh.git synced 2024-09-03 19:36:29 +02:00
minchat_ynh/scripts/backup

26 lines
732 B
Text
Raw Normal View History

2015-04-06 17:46:57 +02:00
#!/bin/bash
2017-04-30 15:45:50 +02:00
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -eu
# Source YNH helpers
source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME
# Retrieve arguments
domain=$(ynh_app_setting_get "$app" domain)
# Backup directory location for the app from where the script is executed and
2015-04-06 17:46:57 +02:00
# which will be compressed afterward
2017-04-30 15:45:50 +02:00
backup_dir=$YNH_APP_BACKUP_DIR
2015-04-06 17:46:57 +02:00
# Backup sources & data
2017-04-30 15:45:50 +02:00
ynh_backup "/var/www/${app}" "sources"
2015-04-06 17:46:57 +02:00
2017-04-30 15:45:50 +02:00
# Copy Nginx conf
sudo mkdir -p ./conf
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "conf/nginx.conf"
# Copy the php-fpm conf files
ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"
ynh_backup "/etc/php5/fpm/conf.d/20-${app}.ini" "php-fpm.ini"