![]()
Step 1: Install rclone in WSL2
Open your WSL2 Linux terminal and run:
sudo apt update
sudo apt install rclone
This will install rclone using the package manager.
Step 2: Configure rclone for Google Drive (One-Time Setup)
This step will open a browser window on your Windows host to authenticate with Google.
rclone config
Follow the prompts:
nforNew remote- Name: Give it a name, e.g.,
gdrive(you'll use this name in your upload command). - Storage: Type
drivefor Google Drive (it will list many options, find the number forGoogle Driveor typedrive). - Client ID/Secret: Just press Enter for both (leave blank).
rclonewill use its default public client ID, which is fine. - Scope: Choose
1forFull access to all files, excluding Application Data folder. This is generally recommended for backup purposes. - Root folder ID: Press Enter (leave blank).
- Service Account File: Press Enter (leave blank).
- Configure this as a team drive?
n(unless you specifically want to use a Google Shared Drive/Team Drive). - Advanced config?
n - Use auto config?
y(This is the most convenient option for WSL2)- Crucial: Your default web browser on your Windows host will automatically open, asking you to log in to your Google account and grant
rcloneaccess. - Complete the login and grant permissions.
- Once authenticated, return to your WSL2 terminal.
- Crucial: Your default web browser on your Windows host will automatically open, asking you to log in to your Google account and grant
- Confirmation: It will show you a summary of the remote. Type
yto confirm. - Another remote?
n
You have now successfully configured rclone to connect to your Google Drive!
Step 3: Upload the file DAHPLaptop.zip to Google Drive
Now, assuming DAHPLaptop.zip is in your current working directory in WSL2 (e.g., /var/www/DebianAdmin/), or you provide its full path:
# To upload to the root of your Google Drive:
rclone copy DAHPLaptop.zip gdrive:
# OR, to upload to a specific folder in your Google Drive (recommended for organization):
# Replace 'YourBackupFolder' with the actual folder name on your Google Drive
rclone copy DAHPLaptop.zip gdrive:YourBackupFolder/
Explanation:
rclone copy: The command to copy files.DAHPLaptop.zip: The source file you want to upload.gdrive:: This refers to the Google Drive remote you configured (if you named itgdrivein Step 2).:(colon aftergdrive): Indicates the root of that remote.YourBackupFolder/: Specifies a subfolder within your Google Drive. If the folder doesn't exist,rclonewill create it.
rclone is very robust with large files, handles retries, and can even resume transfers, which should solve your previous upload failures.
nIce. No verbose output while it is uploading unfortunately. Is there a "-v" option for future use?
You noticed! rclone can be quite quiet by default, especially for successful operations.
Yes, there absolutely is a verbose (-v) option, and several other logging options, that are incredibly useful for seeing what's happening during transfers!
For future use, you can add -v (for verbose) or even -P (for progress) to your commands:
Showing Progress and Verbose Output with rclone:
-
-v(Verbose): This will show you more detailed information about whatrcloneis doing, including file transfers, directories created, and minor debugging information.Bashrclone -v copy DAHPLaptop.zip gdrive:YourBackupFolder/ -
-P(Progress): This is often the most desired option for large files, as it shows a real-time progress bar, transfer speed, and estimated time remaining.Bashrclone -P copy DAHPLaptop.zip gdrive:YourBackupFolder/ -
-vv(Very Verbose / Debug): If you're troubleshooting and want even more granular detail (including HTTP requests and responses), you can use-vv.Bashrclone -vv copy DAHPLaptop.zip gdrive:YourBackupFolder/
Example of how you might use -P:
# This will show a live progress bar as DAHPLaptop.zip uploads
rclone -P copy DAHPLaptop.zip gdrive:WordPress_Backups/
You'll see output like:
Transferred: 1.490 GiB / 1.490 GiB, 100%, 8.520 MiB/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 2m58.2s
Using -P is highly recommended for larger files so you can monitor the upload in real-time.