2
0

restore 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # RESTORE THE APP MAIN DIR
  10. #=================================================
  11. ynh_script_progression --message="Restoring the app main directory..." --weight=1
  12. ynh_restore_file --origin_path="$install_dir"
  13. chown -R "root:root" "$install_dir"
  14. #=================================================
  15. # RESTORE THE DATA DIRECTORY
  16. #=================================================
  17. ynh_script_progression --message="Restoring the data directory..." --weight=1
  18. ynh_restore_file --origin_path="$data_dir" --not_mandatory
  19. chown -R "root:root" "$data_dir"
  20. #=================================================
  21. # RESTORE SYSTEM CONFIGURATIONS
  22. #=================================================
  23. ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
  24. ynh_restore_file --origin_path="/etc/logrotate.d/$app"
  25. ynh_restore_file --origin_path="/etc/cron.d/$app"
  26. #=================================================
  27. # RESTORE VARIOUS FILES
  28. #=================================================
  29. ynh_restore_file --origin_path="/var/log/$app/"
  30. #=================================================
  31. # END OF SCRIPT
  32. #=================================================
  33. ynh_script_progression --message="Restoration completed for $app" --last