This article provides a detailed step-by-step description of how to generate a full VPS backup using
rclone
.
What is rclone
?
Rclone
is a powerful open-source command-line tool for managing files on cloud storage services and local storage. You can think of it as kind of like “rsync” (the popular file-copying tool), but specifically designed to work with cloud providers.
At its core, rclone can:
- Upload, download, sync, and copy files between your local computer, servers, and over 90 cloud storage providers (like Google Drive, Dropbox, S3, OneDrive, Backblaze B2, etc.)
- Mount cloud storage as a local filesystem
- Encrypt files before uploading
- Serve files over HTTP, WebDAV, FTP, or SFTP
- Schedule backups, sync directories, and even do server-to-server migrations with no local download
Some common use cases:
- Backup your VPS to Google Drive automatically
- Move large datasets between AWS S3 and Wasabi
- Mount your Dropbox as a drive on your Linux server
- Sync an encrypted folder to Backblaze B2
- Copy a full remote Google Drive folder to a local NAS
Quick example command:
rclone sync /local/folder remote:backup-folder
Where remote
could be, say, your Google Drive or Dropbox account (configured beforehand).
Why people love it:
- Lightweight and fast
- Highly configurable
- Supports crypt, compression, bandwidth throttling
- Free and open source
How to Generate a Full VPS Backup Using rclone
To generate a full VPS backup using rclone
, follow the steps provided below:
-
Install
rclone
on your VPSFirst, you need
rclone
installed.curl https://rclone.org/install.sh | sudo bash
Check it’s installed:
rclone version
-
Set Up Your Remote Storage
You need to tell
rclone
where you want to send the backup (Google Drive, S3, Dropbox, etc.).Start config:
rclone config
Follow the prompts:
- New remote →
n
- Name → (something like
gdrive_backup
) - Storage type → pick your cloud provider
- Authentication → follow the steps (may need browser auth)
Check your remote:
rclone listremotes
You should see something like:
gdrive_backup:
- New remote →
-
Decide What to Back Up
You can back up:
- Your entire
/
(full filesystem), or - Just key directories:
/etc
,/home
,/var/www
,/opt
, etc.
⚠️ Warning: Backing up the entire system including
/proc
,/sys
,/dev
and/tmp
is a bad idea. Those are virtual or ephemeral filesystems.Better strategy:
Create a backup folder that excludes risky stuff.Example exclude list:
/etc /home /var/www /opt /root /usr/local
- Your entire
-
Create a Backup Archive (Optional but Recommended)
Why?
- Compresses files = faster upload
- Packs everything = easier to restore
Use
tar
to create an archive:sudo tar --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/tmp --exclude=/mnt --exclude=/media --exclude=/run -czvf /root/fullbackup.tar.gz /
Explained:
--exclude
skips volatile directories-czvf
= compress, zip, verbose, file
You’ll get
/root/fullbackup.tar.gz
. -
Upload Backup to Remote Storage
Simple upload:
rclone copy /root/fullbackup.tar.gz gdrive_backup:/VPS-Backups/
Or if you’re backing up folders directly without tar:
rclone sync /etc gdrive_backup:/VPS-Backups/etc rclone sync /home gdrive_backup:/VPS-Backups/home rclone sync /var/www gdrive_backup:/VPS-Backups/www
-
(Optional) Automate with a Cron Job
You don’t want to remember this every day. Set up a cronjob.
Edit crontab:
crontab -e
Add a line like:
0 3 * * * /usr/bin/tar --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/tmp --exclude=/mnt --exclude=/media --exclude=/run -czf /root/fullbackup.tar.gz / && /usr/bin/rclone copy /root/fullbackup.tar.gz gdrive_backup:/VPS-Backups/
Meaning: Every day at 3:00 AM, it will:
- Create a fresh tar.gz
- Upload it
-
(Optional) Add Encryption
To make it safer, encrypt backups.
Use
rclone
‘s crypt backend:During
rclone config
, create acrypt
remote that encryptsgdrive_backup:/VPS-Backups/
so data is encrypted at rest.Then upload to the encrypted remote instead.
Quick Summary
Step | Action |
---|---|
1 | Install rclone |
2 | Configure remote storage |
3 | Choose what to backup |
4 | (Optional) Create a tar archive |
5 | Upload using rclone copy |
6 | (Optional) Automate with cron |
7 | (Optional) Encrypt backups |
Alternate Guide: Generate a Full VPS Backup with rclone
– 1 Step Guide
To generate a full VPS backup with rclone
and store the backup in Google Drive (at “VPS Backups” folder), you can use our convenient 1-step process:
- Login via SSH as root, run the following commands:
wget https://raw.githubusercontent.com/Rad-Web-Hosting/vps-backup-rclone/refs/heads/main/vps_backup.sh chmod +x vps_backup.sh ./vps_backup.sh
That’s it! The backup will be generated and sent to your Google Drive folder, titled “VPS Backups”.
Conclusion
You now know how to generate a full VPS backup using rclone
.