Como usar o RClone
O que é? Como usar? Onde vive? O que come?
Steps for using RClone with Google Drive
- Get your Google Drive Api Client ID and Client Secret, either in saved in your computer or directly with Google at https://console.developers.google.com/
- Install RClone
- Run the command
rclone config
- Run the following options:
n)
New Remotename>
drive (or whatever other name you want)storage>
driveclient_id>
PASTE YOUR CLIENT ID FROM GOOGLE DRIVE API HEREclient_secret>
PASTE YOUR CLIENT SECRET FROM GOOGLE DRIVE API HEREscope>
1root_folder_id>
LEAVE BLANKservice_account_file>
LEAVE BLANKEdit advanced config? | y/n>
nUse auto config? | y/n>
y- DO THE LOGIN IN THE BROWSER WINDOW OPENED
Configure this as a team drive? | y/n>
nIs this remote OK? | y/e/d>
yWhat to do now? | e/n/d/r/c/s/q>
q
RClone Commands
List files
Standard ls is recursive
rclone ls remote:path
With the param
--max-depth
you can decide how much recursive thels
will be, with value1
it is not recursive
rclone ls remote:path --max-depth 1
rclone ls drive:
rclone ls drive: --max-depth 1
rclone ls drive:documents/cv
List directories
rclone lsd remote:path
rclone lsd drive:
rclone lsd drive:jhow
rclone lsd drive:jhow/art
Copy files
rclone copy remote:path local:path
rclone copy local:path remote:path
rclone copy desktop/file.md drive:jhow/temp
rclone copy drive:documents/cv/curriculum.pdf desktop
Move files
rclone move remote:path local:path
rclone move local:path remote:path
rclone move desktop/file.md drive:jhow/temp
rclone move drive:documents/cv/curriculum.pdf desktop
Create folder
rclone mkdir remote:folder
rclone mkdir drive:someFolder
Move file or directory
rclone moveto source:something destination:something
rclone moveto drive:file.md drive:jhow/file.md
Deleting files
Delete a empty folder
rclone rmdir remote:folder
rclone rmdir drive:someFolder
Delete all empty folders inside a directory
rclone rmdirs remote:folder
rclone rmdirs drive:someFolder
Delete a filled folder
rclone purge remote:folder
rclone purge drive:someFolder
Delete a file
rclone delete remote:file.ext
rclone delete drive:file.md
Advanced delete
Delete files bigger than 100MB inside a folder
rclone --min-size 100M delete remote:path
Get size of file
rclone size remote:file
rclone size drive:
rclone size drive:jhow
Show file content
rclone cat remote:file
rclone cat drive:file.md
Sync
Simple sync
rclone sync source:path destination:path
Show progress
rclone sync source:path destination:path -P
Show what would be synced, withou syncing, useful for knowing exactly what would be changed, to prevent data loss
rclone sync source:path destination:path --dry-run