2
0

backup 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #=================================================
  9. # DECLARE DATA AND CONF FILES TO BACKUP
  10. #=================================================
  11. ynh_print_info --message="Declaring files to be backed up..."
  12. #=================================================
  13. # BACKUP THE APP MAIN DIR
  14. #=================================================
  15. ynh_backup --src_path="$install_dir"
  16. #=================================================
  17. # BACKUP SYSTEM
  18. #=================================================
  19. ynh_backup --src_path="/etc/logrotate.d/$app"
  20. ynh_backup --src_path="/etc/cron.d/$app"
  21. #=================================================
  22. # BACKUP VARIOUS FILES
  23. #=================================================
  24. ynh_backup --src_path="/var/log/$app/"
  25. #=================================================
  26. # END OF SCRIPT
  27. #=================================================
  28. ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."