backup.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. IP=$(wget -qO- icanhazip.com);
  3. date=$(date +"%Y-%m-%d")
  4. clear
  5. echo " Enter Your Email To Receive Message"
  6. read -rp " Email: " -e email
  7. sleep 1
  8. echo Membuat Directory
  9. mkdir /root/backup
  10. sleep 1
  11. echo Start Backup
  12. clear
  13. cp /etc/passwd backup/
  14. cp /etc/group backup/
  15. cp /etc/shadow backup/
  16. cp /etc/gshadow backup/
  17. cp -r /etc/wireguard backup/wireguard
  18. cp /etc/ppp/chap-secrets backup/chap-secrets
  19. cp /etc/ipsec.d/passwd backup/passwd1
  20. cp /etc/shadowsocks-libev/akun.conf backup/ss.conf
  21. cp -r /var/lib/crot-script/ backup/crot-script
  22. cp -r /var/lib/crot-script/ipvps.conf
  23. cp -r /var/lib/premium-script/ipvps.conf
  24. cp -r /etc/v2ray/domain
  25. cp -r /home/sstp backup/sstp
  26. cp -r /etc/v2ray backup/v2ray
  27. cp -r /etc/trojan backup/trojan
  28. cp -r /usr/local/shadowsocksr/ backup/shadowsocksr
  29. cp -r /home/vps/public_html backup/public_html
  30. cd /root
  31. zip -r $IP-$date.zip backup > /dev/null 2>&1
  32. rclone copy /root/$IP-$date.zip dr:backup/
  33. url=$(rclone link dr:backup/$IP-$date.zip)
  34. id=(`echo $url | grep '^https' | cut -d'=' -f2`)
  35. link="https://drive.google.com/u/4/uc?id=${id}&export=download"
  36. echo -e "The following is a link to your vps data backup file.
  37. $link
  38. If you want to restore data, please enter the link above.
  39. Thank You For Using Our Services" | mail -s "Backup Data" $email
  40. rm -rf /root/backup
  41. rm -r /root/$IP-$date.zip
  42. echo "Done"
  43. echo "Please Check Your Email"