backup 1.0 KB

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. source ../settings/scripts/_common.sh
  3. source /usr/share/yunohost/helpers
  4. ynh_print_info --message="Declaring files to be backed up..."
  5. ynh_backup --src_path="$install_dir"
  6. ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
  7. ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
  8. ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
  9. ynh_backup --src_path="/etc/logrotate.d/$app"
  10. ynh_backup --src_path="/opt/couchdb/etc/local.d/05-flohmarkt.ini"
  11. # for the following backups we'll want to stop flohmarkt and couchdb
  12. # to guarentee a consistant state
  13. ynh_print_info --message="Stopping flohmarkt and couchdb to backup data..."
  14. yunohost service stop flohmarkt
  15. systemctl stop couchdb
  16. ynh_backup --src_path="$data_dir" --is_big
  17. ynh_backup --src_path="/var/lib/couchdb" --is_big
  18. ynh_print_info --message="...done. Starting couchdb and flohmarkt."
  19. systemctl start couchdb
  20. yunohost service start flohmarkt
  21. ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."