backup 613 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # This backup script is adapted to Yunohost >=2.4
  3. # The parameter $1 is the backup directory location dedicated to the app
  4. # which will be compressed afterward
  5. backup_dir=$1
  6. # The parameter $2 is theid of the app instance ex: ynhexample__2
  7. app=$2
  8. # Backup sources & data
  9. final_path=/var/www/$APP
  10. sudo cp -a $final_path "${backup_dir}/www"
  11. # Copy conf file
  12. sudo mkdir -p "${backup_dir}/conf"
  13. domain=$(sudo yunohost app setting $app domain)
  14. sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf "${backup_dir}/conf/nginx.conf"
  15. # Since Yunohost 2.4 no need to backup settings in /etc/yunohost/apps/$app