backup 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. # BACKUP THE NGINX CONFIGURATION
  20. #=================================================
  21. ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
  22. #=================================================
  23. # BACKUP SYSTEMD
  24. #=================================================
  25. ynh_backup --src_path="/etc/systemd/system/$app.service"
  26. #=================================================
  27. # END OF SCRIPT
  28. #=================================================
  29. ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."