backup.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. red='\e[1;31m'
  3. green='\e[0;32m'
  4. NC='\e[0m'
  5. MYIP=$(wget -qO- https://icanhazip.com);
  6. echo "Checking VPS"
  7. IP=$(wget -qO- https://icanhazip.com);
  8. date=$(date +"%Y-%m-%d")
  9. clear
  10. echo " Enter Your Email To Receive Message"
  11. read -rp " Email: " -e email
  12. sleep 1
  13. echo Membuat Directory
  14. mkdir /root/backup
  15. sleep 1
  16. echo Start Backup
  17. clear
  18. cp /etc/passwd backup/
  19. cp /etc/group backup/
  20. cp /etc/shadow backup/
  21. cp /etc/gshadow backup/
  22. cp -r /etc/wireguard backup/wireguard
  23. cp /etc/ppp/chap-secrets backup/chap-secrets
  24. cp /etc/ipsec.d/passwd backup/passwd1
  25. cp /etc/shadowsocks-libev/akun.conf backup/ss.conf
  26. cp -r /var/lib/premium-script/ backup/premium-script
  27. cp -r /home/sstp backup/sstp
  28. cp -r /etc/v2ray backup/v2ray
  29. cp -r /etc/trojan backup/trojan
  30. cp -r /usr/local/shadowsocksr/ backup/shadowsocksr
  31. cp -r /home/vps/public_html backup/public_html
  32. cd /root
  33. zip -r $IP-$date.zip backup > /dev/null 2>&1
  34. rclone copy /root/$IP-$date.zip dr:backup/
  35. url=$(rclone link dr:backup/$IP-$date.zip)
  36. id=(`echo $url | grep '^https' | cut -d'=' -f2`)
  37. link="https://drive.google.com/u/4/uc?id=${id}&export=download"
  38. echo -e "SUCCESSFULL BACKUP YOUR VPS
  39. Please Save The Following Data
  40. ============================================
  41. Your VPS IP : $IP
  42. Link Backup : $link
  43. ============================================
  44. Please enter the link above If you want to restore data
  45. © Copyright 2021 By OKKAY-KAYYO" | mail -s "Backup Data" $email
  46. rm -rf /root/backup
  47. rm -r /root/$IP-$date.zip
  48. echo ""
  49. figlet -c DONE | lolcat
  50. echo "Please Check Your Email"
  51. echo ""