1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/strut_ynh.git synced 2024-09-03 20:26:33 +02:00
strut_ynh/scripts/backup

15 lines
388 B
Bash

#!/bin/bash
APP=${!#}
# The parameter $1 is the backup directory location dedicated to the app
BACKUP_DIR=$1
domain=$(sudo yunohost app setting $APP domain)
# Copy the app files
final_path=/var/www/$APP
sudo cp -a $final_path "${BACKUP_DIR}/www"
# Copy the conf files
sudo mkdir -p "${BACKUP_DIR}/conf"
sudo cp -a /etc/nginx/conf.d/$domain.d/$APP.conf "${BACKUP_DIR}/conf/nginx.conf"