Install rclone from https://rclone.org/downloads/
curl https://rclone.org/install.sh | sudo bash
Run rclone config
for google drive (setup directions here).
To see directories and files in drive (note: I set up my google drive remote name as 'gdrive'):
rclone lsd gdrive:/ # dirs
rclone ls gdrive:/ # dirs + files
Given a folder 'data' in my google drive I want to download to server:
rclone copy gdrive:/data . -P
If someone shares a folder, use --drive-shared-with-me
:
rclone copy gdrive:/shared_data . -P --drive-shared-with-me
First check version rclone -V
, if less than 1.54 install beta:
curl https://rclone.org/install.sh | sudo bash -s beta
Now get public file id, for example given link
https://drive.google.com/file/d/FILE_ID/view
where FILE_ID
will be hash string, run
rclone backend copyid gdrive: FILE_ID `pwd`/example_file