#!/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"