backup 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. #=================================================
  3. # GENERIC START
  4. #=================================================
  5. # IMPORT GENERIC HELPERS
  6. #=================================================
  7. source ../settings/scripts/_common.sh
  8. source /usr/share/yunohost/helpers
  9. #=================================================
  10. # MANAGE SCRIPT FAILURE
  11. #=================================================
  12. # Exit if an error occurs during the execution of the script
  13. ynh_abort_if_errors
  14. #=================================================
  15. # LOAD SETTINGS
  16. #=================================================
  17. app=$YNH_APP_INSTANCE_NAME
  18. final_path=$(ynh_app_setting_get $app final_path)
  19. #=================================================
  20. # STANDARD BACKUP STEPS
  21. #=================================================
  22. # BACKUP THE APP MAIN DIR
  23. #=================================================
  24. ynh_backup "$final_path"
  25. #=================================================
  26. # SPECIFIC BACKUP
  27. #=================================================
  28. # BACKUP LOGROTATE
  29. #=================================================
  30. ynh_backup "/etc/logrotate.d/$app"
  31. #=================================================
  32. # BACKUP THE CRON FILE
  33. #=================================================
  34. ynh_backup "/etc/cron.d/$app"