backup 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. #=================================================
  3. # GENERIC START
  4. #=================================================
  5. # IMPORT GENERIC HELPERS
  6. #=================================================
  7. # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
  8. source ../settings/scripts/_common.sh
  9. source /usr/share/yunohost/helpers
  10. #=================================================
  11. # DECLARE DATA AND CONF FILES TO BACKUP
  12. #=================================================
  13. ynh_print_info --message="Declaring files to be backed up..."
  14. #=================================================
  15. # BACKUP THE APP MAIN DIR
  16. #=================================================
  17. ynh_backup --src_path="$install_dir"
  18. #=================================================
  19. # SYSTEM CONFIGURATION
  20. #=================================================
  21. ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
  22. ynh_backup --src_path="/etc/systemd/system/$app.service"
  23. #=================================================
  24. # END OF SCRIPT
  25. #=================================================
  26. ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."