backup 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. #=================================================
  3. # IMPORT GENERIC HELPERS
  4. #=================================================
  5. # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
  6. source ../settings/scripts/_common.sh
  7. source /usr/share/yunohost/helpers
  8. ynh_print_info "Declaring files to be backed up..."
  9. #=================================================
  10. # BACKUP THE APP MAIN DIR
  11. #=================================================
  12. ynh_backup "$install_dir"
  13. #=================================================
  14. # BACKUP SYSTEM
  15. #=================================================
  16. ynh_backup "/etc/logrotate.d/$app"
  17. ynh_backup "/etc/cron.d/$app"
  18. #=================================================
  19. # BACKUP VARIOUS FILES
  20. #=================================================
  21. ynh_backup "/var/log/$app/"
  22. #=================================================
  23. # END OF SCRIPT
  24. #=================================================
  25. ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."