Prerequisites
Before setting up Google Drive backup, make sure you have:
- Google account with Google Drive access
- SSH access to your VPS
Install and Configure Rclone
curl https://rclone.org/install.sh | sudo bash
Configure Google Drive:
rclone config
Follow prompts:
- Select n) New remote
- Name: gdrive
- Type: drive
- Client ID: Leave blank
- Client Secret: Leave blank
- Scope: 1 (full drive access)
- Root folder ID: Leave blank
- Service Account: Leave blank
- Edit advanced config: n
- Use auto config: n (if headless server)
- Follow URL in browser to authorize
- Paste verification code
Google Drive Backup Script
#!/bin/bash
# Create backup
/usr/local/hestia/bin/v-backup-users
# Sync to Google Drive
rclone sync /backup/ gdrive:HestiaBackups/
# Keep only last 7 days locally
find /backup -name "*.tar" -mtime +7 -delete
# Log
echo "$(date): Backup to Google Drive completed" >> /var/log/gdrive-backup.log
Make executable:
chmod +x /root/gdrive-backup.sh
Schedule Backup
crontab -e
Add:
0 2 * * * /root/gdrive-backup.sh
Restore from Google Drive
# List backups
rclone ls gdrive:HestiaBackups/
# Download specific backup
rclone copy gdrive:HestiaBackups/admin.2026-04-29.tar /backup/
# Restore
/usr/local/hestia/bin/v-restore-user admin /backup/admin.2026-04-29.tar
Monitor Backup Logs
tail -f /var/log/gdrive-backup.log
✅ Google Drive backup has been configured successfully!