urbackup.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. echo -e '\033[35m
  3. _ _ _ _ ___ _ _ _
  4. | | | |_ _| |__ __ _ __| |___ _ _ __ / __| | (_)___ _ _| |_
  5. | |_| | '_| '_ \/ _` / _| / / || | '_ \ | (__| |__| / -_) ' \ _|
  6. \___/|_| |_.__/\__,_\__|_\_\\_,_| .__/ \___|____|_\___|_||_\__|
  7. |_|
  8. \033[0m'
  9. if [ "$EUID" -ne 0 ]; then
  10. echo "Please run as root"
  11. exit
  12. fi
  13. # get the current position
  14. _cwd="$(pwd)"
  15. # check for assets forlder
  16. _assets="$_cwd/assets"
  17. if [ ! -d "$_assets" ]; then
  18. _assets="$_cwd/../assets"
  19. if [ ! -d "$_assets" ]; then
  20. echo "!! can't find assets directory !!"
  21. exit
  22. fi
  23. fi
  24. # install urbackup client
  25. # https://www.urbackup.org/client_debian_ubuntu_install.html
  26. # https://blog.stephane-huc.net/systeme/debian/urbackup_client_gui
  27. # https://urbackup.atlassian.net/wiki/spaces/US/pages/9142274/Headless+Linux+client+setup
  28. # Install the dependencies UrBackup needs
  29. apt install build-essential "g++" "libcrypto++-dev" libz-dev
  30. # libwxgtk3.0-dev
  31. # Download the UrBackup client source files and extract them
  32. wget -P /tmp/ https://hndl.urbackup.org/Client/latest/urbackup-client-2.2.5.tar.gz
  33. cd /tmp
  34. tar xzf /tmp/urbackup-client-2.2.5.tar.gz
  35. # Build the UrBackup client and install it
  36. cd /tmp/urbackup-client-2.2.5
  37. ./configure --enable-headless
  38. make -j4
  39. make install
  40. # Make sure that the UrBackup client backend runs correctly
  41. urbackupclientbackend -v info
  42. # install and enable systemd service
  43. cp "$_assets"/urbackup.service /etc/ststemd/system/
  44. chmod a+x /etc/ststemd/system/urbackup.service
  45. systemctl --system daemon-reload
  46. systemctl start urbackup.service
  47. systemctl enable urbackup.service