restore 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 "Restoring the app main directory..."
  12. ynh_restore "$install_dir"
  13. #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "root:root" "$install_dir"
  14. #=================================================
  15. # RESTORE THE DATA DIRECTORY
  16. #=================================================
  17. ynh_script_progression "Restoring the data directory..."
  18. ynh_restore "$data_dir"
  19. chown -R "root:root" "$data_dir"
  20. #=================================================
  21. # RESTORE SYSTEM CONFIGURATIONS
  22. #=================================================
  23. ynh_script_progression "Restoring system configurations related to $app..."
  24. ynh_restore "/etc/logrotate.d/$app"
  25. ynh_restore "/etc/cron.d/$app"
  26. #=================================================
  27. # RESTORE VARIOUS FILES
  28. #=================================================
  29. ynh_restore "/var/log/$app/"
  30. #=================================================
  31. # END OF SCRIPT
  32. #=================================================
  33. ynh_script_progression "Restoration completed for $app"