-
Notifications
You must be signed in to change notification settings - Fork 2
How to use gdrive.bash
rootorchild edited this page Dec 2, 2019
·
4 revisions
thanh4@ubuntu1804:~$ gdrive.bash --help
gdrive.bash - Simple upload to Google Drive use curl
Usage: gdrive.bash [options] [command] [file ID]
Options:
--about show Google account informations
--upload upload to Google Drive
--list list directory and file
all list all directory and file
dir list directory only
file list file only
--mkdir create directory on Google Drive
--delete delete file or directory on Google Drive
--info show info of file
name show name only
mimeType show mimeType only
--download download file. Not download directory
--help show this help message and exit
| Command | gdrive.bash --about |
|---|---|
| Purpose | show Google account informations |
| Result | Email + Total + Used + Free |
| Example |
gdrive.bash --aboutEmail: backupxxxxxx@gmail.comTotal: 15.00 GBUsed : 7.05 KBFree : 15.00 GB
|
| Command | gdrive.bash --upload [file or dir] [fileID] |
|---|---|
| Purpose | Upload file or directory to Google Drive If you want to upload to specific folder in Google Drive, add fileID of this folder at last. |
| Result | Show upload processing |
| Example | Upload to root directory:gdrive.bash --upload binCreating directory bin...Uploading file butgg.bash...Uploading file cron_backup.bash...Uploading file gdrive.bash...Upload to directory with specific file ID: gdrive.bash --upload butgg.bash 1ZhNqnaXBzjfmdFn0ps1r7S4pGCiNyMhgUploading file Uploading file...
|
| Command | gdrive.bash --list [command] [file ID] |
|---|---|
| Command |
all list all directory and filedir list directory onlyfile list file only |
| Purpose | List directory and file |
| Result OK | Show list file (and/or) directory |
| Result Fail | Show "Can not find file ID" |
| Example |
gdrive.bash --list all root1ZhNqnaXBzjfmdFn0ps1r7S4pGCiNyMhg bin1Rp0P9DNtx-mcJNLIUPp-7j4pwX3LKaOX .profile1nkocDkP5m90VgV-GqZHFexaL3tCLsgYn butgg.log1WaJR_5sT9GmE6lPm9IM-VX09J8UmmGGb 29_11_2019gdrive.bash --list file 1ZhNqnaXBzjfmdFn0ps1r7S4pGCiNyMhg1rJTjylcfEBuuDvEqHt9glNbiOIpOwlnL gdrive.bash1-0lwBfk8_iARImZdyUuua_ZpsUCqaBJu cron_backup.bash1gmcXAlBZhrg6YoEh8Rj9rOgdY_4lbjeL butgg.bashgdrive.bash --list all 1111Can not find file ID
|
| Command | gdrive.bash --mkdir [dir name] [file ID] |
|---|---|
| Purpose | Create directory on Google Drive If you want to create directory to specific folder in Google Drive, add fileID of this folder at last. |
| Result | file ID of new directory |
| Result Fail | Show "Can not find file ID" |
| Example |
gdrive.bash --mkdir butgg1XLWvin8C5lL0HVJNHbSvdkJBQhHTLYI0gdrive.bash --mkdir butgg 1XLWvin8C5lL0HVJNHbSvdkJBQhHTLYI01nsRiGRo8XiKO9J7QWZ-wZq0450oqWFmqgdrive.bash --mkdir butgg 1111Can not find file ID
|
| Command | gdrive.bash --delete [file ID] |
|---|---|
| Purpose | Delete file or directory on Google Drive |
| Result OK | Show "Deleted file ID [file ID]" |
| Result Fail | Show "Can not find file ID" |
| Example |
gdrive.bash --delete 1XLWvin8C5lL0HVJNHbSvdkJBQhHTLYI0Deleted file ID 1XLWvin8C5lL0HVJNHbSvdkJBQhHTLYI0gdrive.bash --delete 1111Can not find file ID
|
| Command | gdrive.bash --info [command] [file ID] |
|---|---|
| Command |
name show name onlymimeType show mimeType onlytrashed show file or directory in trash or not |
| Purpose | Show info of file or directory |
| Result OK | Show name or mimeType or (false or true) |
| Result Fail | Show "Can not find file ID" |
| Example |
gdrive.bash --info name 1WaJR_5sT9GmE6lPm9IM-VX09J8UmmGGb29_11_2019gdrive.bash --info mimeType 1111Can not find file IDgdrive.bash --info trashed 1PytnPTSxnxWRJ5P_93SkQGYvQTi4tiHkfalse
|
| Command | gdrive.bash --download [file ID] |
|---|---|
| Purpose | Download file. Not download directory |
| Result OK | Show "Downloading file [file ID]" |
| Result Fail | Show "Do not support download directory" |
| Example |
gdrive.bash --download 1Rp0P9DNtx-mcJNLIUPp-7j4pwX3LKaOXDownloading file 1Rp0P9DNtx-mcJNLIUPp-7j4pwX3LKaOX...gdrive.bash --download 1WaJR_5sT9GmE6lPm9IM-VX09J8UmmGGbDo not support download directory
|