Google Drive Backups
[1.0.5] Sends your game server backups to Google Drive
1.0.4
2 days agoOverview
Google Drive is the final storage for backups. The node (Wings / Agent) is only used as a transit step: the backup is created on the node, streamed to Drive, and the local copy is then deleted automatically. This frees disk space on the node and does not depend on the server's backup limit (backup_limit, even when set to 0 — the value in the database is never modified).
Features
- Manual backup to Drive in one click, from the server's "Google Drive" tab.
- Automatic backups: interval from 1 to 168 h, from 1 to 50 backups kept per server.
- Retention: the oldest automatic backups are deleted from Drive and from the panel. Manual backups are never deleted automatically.
- File selection: back up only specific folders/files (up to 200 paths) instead of the whole server.
- Cross-server restore: every backup on your Drive account is listed, even those from a deleted server, and can be restored onto another server (2-hour temporary download link relayed by the panel).
- One Google account per user: everyone links their own Drive. Remaining storage is displayed and checked before uploading.
- Streamed upload in 8 MiB chunks (resumable upload): a multi-GB backup is never fully loaded into memory.
- Security: drive.file scope only (the extension can only see files it created itself); refresh tokens and the client secret are encrypted in the database.
Panel permissions used
| Action | Required permission |
|---|---|
| View Drive backups | backup.read |
| Start a backup / change settings | backup.create |
| Delete a backup | backup.delete |
| Restore | backup.restore |
The server owner and admins have all permissions.
Requirements
- Reviactyl with the extensions API (RCYL_v26).
- The panel cron:
* * * * * php /var/www/reviactyl/artisan schedule:run >> /dev/null 2>&1- The panel's queue worker running (as for any Reviactyl/Pterodactyl installation).
- The panel must be able to reach googleapis.com / oauth2.googleapis.com, and be reachable over HTTPS by Google (OAuth callback).
- A correct APP_URL in the panel's .env (using https://).
Installation
From the panel directory (/var/www/reviactyl by default):
# 1. Copy gdrive-backups.rext to the panel root, then:
php artisan extension:install gdrive-backups
php artisan extension:enable gdrive-backups
php artisan optimize:clearThe tables (gdrive_config, gdrive_accounts, gdrive_server_settings, gdrive_backups) are created automatically, without running php artisan migrate.
Check: php artisan extensions:list should show the extension as enabled, and php artisan list gdrive should display gdrive:configure, gdrive:schedule and gdrive:upload.
Google (OAuth) setup
Do this once, as the panel administrator.
1. Get the redirect URI
php artisan gdrive:configureThe command prints the redirect URI, in the form:
Keep it: it must be copied exactly (same scheme, same domain, no trailing /) into Google Cloud.
2. Create a Google Cloud project
- Go to https://console.cloud.google.com/ and create a project (e.g. "Reviactyl Backups").
- APIs & Services → Library → search for Google Drive API → Enable.
3. Configure the OAuth consent screen
APIs & Services → OAuth consent screen (or "Google Auth Platform"):
- User type: External (or Internal if everyone uses an account from your Google Workspace organization).
- Fill in the app name, support email and developer email.
- Scopes — add only:
- Publishing: set the app to "In production".
⚠️ Important: while the app is in Testing mode, Google makes the refresh token expire after 7 days. Backups will then fail with invalid_grant and you would have to relink the account every week. Switch to production. The two scopes above are non-sensitive scopes, so Google verification is normally not required.
If you stay in Testing mode, add each user account under Test users.
4. Create the credentials
APIs & Services → Credentials → Create credentials → OAuth client ID:
- Application type: Web application
- Authorized redirect URIs: the URI from step 1
- Save, then copy the Client ID and the Client secret.
5. Save the credentials in the panel
php artisan gdrive:configure "CLIENT_ID.apps.googleusercontent.com" "CLIENT_SECRET"The secret is stored encrypted in the database. Check with php artisan gdrive:configure: Configured: yes.
Alternative using environment variables (panel .env):
GDRIVE_CLIENT_ID=xxxxxxxx.apps.googleusercontent.com
GDRIVE_CLIENT_SECRET=xxxxxxxxValues saved with gdrive:configure take priority over .env.
Usage
Link your Google account
- Open a server → Google Drive tab.
- Click Link my Google account and accept the permissions.
- You are redirected back to the panel: the account email and remaining storage are displayed.
To unlink: use the disconnect button (the token is revoked at Google, and automatic backups for that account are disabled; files already on Drive are kept).
Manual backup
Click Back up now. The status progresses as follows:
| Status | Meaning |
|---|---|
| Pending | Backup being created on the node, or waiting to be uploaded |
| Uploading | Transfer to Drive in progress |
| Uploaded | On Drive; the node's local copy is deleted |
| Failed | See the error message shown on the row |
Files are created in a dedicated Drive folder per server: Reviactyl - ServerName (shortUuid), named name-xxxxxxxx.tar.gz.
Automatic backups
In the server settings: enable automatic backups, choose the interval (hours) and the number to keep. The first backup starts on the next scheduler run. A new backup is only started once the previous one has been sent to Drive.
File selection
Pick the folders/files to include; empty = the whole server. The selection works through the daemon's ignore rules (requires a panel version that supports them).
Restore
In the library, pick a backup from your Drive and restore it onto the server you want (stop it first). The panel generates a temporary link (2 h) that the target server's daemon downloads; Drive is never exposed publicly.
How it works
- BackupCreator creates the backup through the panel's native service (with backup_limit raised in memory only).
- gdrive:upload (every minute) picks up backups that completed successfully, checks the quota, generates the node download link, and streams everything to Drive.
- Once the upload is confirmed, the local copy (panel + node disk) is deleted. A locked backup is kept.
- gdrive:schedule (every minute) starts due automatic backups, applies retention, and does the cleanup.
- Safety net: while the interface is open, it relaunches gdrive:upload on its own (at most every 20 s) even if the cron is not working.
Timeouts and automatic cleanup
| Case | Rule |
|---|---|
| Backup "pending" for more than 3 h | Marked as failed ("Timed out") |
| Upload "in progress" for more than 6 h | Marked as failed ("Upload interrupted") |
| Automatic backup failure | Local copy deleted (retried at the next interval) |
| Manual backup failure | Local copy kept for up to 7 days |
| Failures older than 7 days | Deleted (row + local copy) |
Artisan commands
| Command | Purpose |
|---|---|
| php artisan gdrive:configure [id] [secret] | Saves the Google credentials / shows the status and redirect URI |
| php artisan gdrive:upload | Uploads completed pending backups (can be run by hand for debugging) |
| php artisan gdrive:schedule | Starts due automatic backups + retention |
Troubleshooting
| Problem | Likely cause / fix |
|---|---|
| Stays "Pending" | The schedule:run cron is not running. Run php artisan gdrive:upload by hand; if it uploads, check the cron. Keep the page open: the safety net relaunches the upload. Also check that exec() is not disabled in PHP (Plesk: disable_functions). |
| Google Drive is not configured | Run php artisan gdrive:configure ID SECRET. |
| redirect_uri_mismatch | The URI in Google Cloud does not match exactly. Use the one from php artisan gdrive:configure and check APP_URL (https). |
| Access blocked: app not verified | Add your account as a test user, or switch the consent screen to production. |
| invalid_grant / "needs reauthorization" status | Expired token (7 days in Testing mode) or revoked access. Switch to production, then relink the account. |
| Insufficient Google Drive space | Free up space on the Drive or reduce the number of backups kept. |
| Unknown backup size | The node did not finish or failed; start the backup again. |
| Local copy stays on the node | The backup is locked, or the node was unreachable: check storage/logs/laravel-*.log ([gdrive-backups]). |
| Internal extension error | An administrator sees the error details in the response; everything is also in the panel logs. |
Extension logs are in storage/logs/laravel-YYYY-MM-DD.log, prefixed with [gdrive-backups].
Uninstall
php artisan extensions:disable gdrive-backups
The tables and the files already uploaded to Drive are not deleted.