backup 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. #=================================================
  3. # IMPORT GENERIC HELPERS
  4. #=================================================
  5. source ../settings/scripts/_common.sh
  6. source /usr/share/yunohost/helpers
  7. ynh_print_info "Declaring files to be backed up..."
  8. #=================================================
  9. # BACKUP THE APP MAIN DIR
  10. #=================================================
  11. ynh_backup "$install_dir"
  12. #=================================================
  13. # BACKUP THE DATA DIR
  14. #=================================================
  15. ynh_backup "$data_dir"
  16. #=================================================
  17. # BACKUP SYSTEM CONFIGURATION
  18. #=================================================
  19. ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
  20. ynh_backup "/etc/logrotate.d/$app"
  21. #ynh_backup "/etc/fail2ban/jail.d/$app.conf"
  22. #ynh_backup "/etc/fail2ban/filter.d/$app.conf"
  23. #=================================================
  24. # BACKUP VARIOUS FILES
  25. #=================================================
  26. ynh_backup "/var/log/$app/"
  27. #=================================================
  28. # END OF SCRIPT
  29. #=================================================
  30. ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."