Last active
May 26, 2020 01:57
-
-
Save paulproteus/b45c63299280cac3dfee44227c4abd2d to your computer and use it in GitHub Desktop.
Upload a 3TB block device straight to GDrive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/labbots/google-drive-upload | |
+ patch out some `-f` checks to be `-e` (since `-f` is false on a block device) | |
+ replace `wc -c` with `blockdev --getsize64 $filename` to avoid spending 6 hours on `wc -c` before even uploading | |
+ `cp -a` the block device to /tmp/ with a nice filename, so google-drive-upload uses that as the GDrive filename | |
Wait 6 hours or so. | |
Then figure out the MD5 thing to validate the upload. | |
Use https://developers.google.com/drive/api/v3/reference/files/list?apix_params=%7B%22fields%22%3A%22files(md5Checksum%2CoriginalFilename%2CmimeType)%22%7D | |
(note `params`) | |
Run `md5sum < /dev/sdb` (or whatever) and make sure the md5sum matches. | |
The command-line client wants to set the MIME type to some block device MIME type. However, when I do the query above, it seems to believe it's application/octet-stream, which is good. If the md5sum is fine, I guess whatever re: MIME type. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO: Look into rclone, plexdrive