2020年6月6日 星期六

gdrove 2

gdrove

An RClone-like Google Drive tool to help you sync files to and from your personal computer and between Google Drive folders!

install

windows

pip install gdrove

linux

pip3 install gdrove

paths

Paths can be of five types: local (ld), my drive (md), shared drive (sd), file id (fi), and alias.

format

Paths are formatted as path_type:dir1/dir2/dir3, where path_type is the type of path (see below) and dir1/dir2/dir3 is the path to the file from wherever you want.

local (ld)

Local, specified as ld:path/to/some/folder, represent a local directory to download to or upload from.

my drive (md)

My Drive, specified as md:path/to/some/folder, is similar to RClone's method of paths, where the path is revative to your my drive folder.

shared drive (sd)

Shared Drive, specified as sd:drive_name/some/directory, where drive_name is the name of a Shared Drive, reference a file in a Shared Drive, whose name you specify as the first directory.

file id (fi)

File Id, specified as fi:S0M3_F1L3_1D, where S0M3_F1L3_1D is a File Id accessable to your user. This is the biggest thing RClone doesn't have, and allows you to clone from random public directories without having to add them to My Drive.

alias

Alias, specified as alias_name:path/to/some/folder, uses an alias to show some root folder. This feature is still being worked on and will be fleshed out later.

auth

To authenticate with gdrove, you'll need to create a credentials.json in the directory you're running the program in. This requirement may be lifted in the future, with default credentials supplied. You can use gdrove config account user acnt_name to create and authorize a new account named acnt_name. You can also create a Serivce Account using gdrove config account sa acnt_name sa.json to create a new Serivce Account named acnt_name using the Service Account file sa.json.

syncing

To sync, use gdrove sync account_name source_path destination_path, with account_name being the name of an account, source_path being the path to the source folder, and destination_path being the path to the destination folder.

TODO

  • Refactor, putting filtering logic in it's own function with a callback/comparison function
  • Implement multithreaded dtd
  • Measure performance benefits of multithreaded ltd and dtl on high bandwidth machines
  • Implement impersonation (not as bad as it sounds, I swear)

Maybe TODO

  • Implement dtltd (download from drive to local then reupload to other account, for when you want to copy between accounts when only one account has access to each side)

注意事項

https://github.com/googleapis/google-api-python-client/pull/841
https://github.com/googleapis/google-api-python-client/pull/841
https://github.com/googleapis/google-api-python-client/pull/813

fix: exclude 308s from httplib2 redirect codes list #813





類似於RClone的Google雲端硬盤工具,可幫助您在個人計算機之間以及Google雲端硬盤文件夾之間同步文件!

@Spazzlo

https://github.com/googleapis/google-api-python-client/pull/813
https://github.com/googleapis/google-api-python-client/pull/841


gdrove

An RClone-like Google Drive tool to help you sync files to and from your personal computer and between Google Drive folders!

install

windows

pip install gdrove

linux

pip3 install gdrove

paths

Paths can be of five types: local (ld), my drive (md), shared drive (sd), file id (fi), and alias.

format

Paths are formatted as path_type:dir1/dir2/dir3, where path_type is the type of path (see below) and dir1/dir2/dir3 is the path to the file from wherever you want.

local (ld)

Local, specified as ld:path/to/some/folder, represent a local directory to download to or upload from.

my drive (md)

My Drive, specified as md:path/to/some/folder, is similar to RClone's method of paths, where the path is revative to your my drive folder.

shared drive (sd)

Shared Drive, specified as sd:drive_name/some/directory, where drive_name is the name of a Shared Drive, reference a file in a Shared Drive, whose name you specify as the first directory.

file id (fi)

File Id, specified as fi:S0M3_F1L3_1D, where S0M3_F1L3_1D is a File Id accessable to your user. This is the biggest thing RClone doesn't have, and allows you to clone from random public directories without having to add them to My Drive.

alias

Alias, specified as alias_name:path/to/some/folder, uses an alias to show some root folder. This feature is still being worked on and will be fleshed out later.

auth

To authenticate with gdrove, you'll need to create a credentials.json in the directory you're running the program in. This requirement may be lifted in the future, with default credentials supplied. You can use gdrove config account user acnt_name to create and authorize a new account named acnt_name. You can also create a Serivce Account using gdrove config account sa acnt_name sa.json to create a new Serivce Account named acnt_name using the Service Account file sa.json.

syncing

To sync, use gdrove sync account_name source_path destination_path, with account_name being the name of an account, source_path being the path to the source folder, and destination_path being the path to the destination folder.

TODO

  • Refactor, putting filtering logic in it's own function with a callback/comparison function
  • Implement multithreaded dtd
  • Measure performance benefits of multithreaded ltd and dtl on high bandwidth machines
  • Implement impersonation (not as bad as it sounds, I swear)

Maybe TODO

  • Implement dtltd (download from drive to local then reupload to other account, for when you want to copy between accounts when only one account has access to each side)

Rclone將您的文件同步到雲存儲2

安裝和文檔

請訪問rclone網站以獲取:

資料下載

執照

這是MIT許可條款下的免費軟件(請檢查此軟件包中包含的 COPYING文件)。

Rclone將您的文件同步到雲存儲

https://rclone.org/

Rclone將您的文件同步到雲存儲


About rclone

Rclone is a command line program to manage files on cloud storage. It is a feature rich alternative to cloud vendors' web storage interfaces. Over 40 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.

Rclone has powerful cloud equivalents to the unix commands rsync, cp, mv, mount, ls, ncdu, tree, rm, and cat. Rclone's familiar syntax includes shell pipeline support, and --dry-run protection. It can be used at the command line, in scripts or via its API.

Users have called rclone "The Swiss army knife of cloud storage" and "Technology indistinguishable from magic".

Rclone really looks after your data. It preserves timestamps and verifies your data at all times. Transfers over limited bandwidth; intermittent connections, or subject to quota can be restarted, from the last good file transferred. You can check the integrity of your files. Where possible, rclone employs server side transfers to minimise local bandwidth use and transfers from one provider to another without using your local disk.

Virtual backends wrap local and cloud file systems to apply encryptioncachingchunking and joining.

Rclone can mount any local, cloud or virtual filesystem as a disk on Windows, macOS, linux and FreeBSD, and also serve these over SFTPHTTPWebDAVFTP and DLNA.

Rclone is mature, open source software originally inspired by rsync and written in Go. The friendly support community are familiar with varied use cases. Official Ubuntu, Debian, Fedora, Brew and Chocolatey repos. include rclone. For the latest version downloading from rclone.org is recommended.

Rclone is widely used on Linux, Windows and Mac. Third party developers have built innovative backup, restore, GUI and business process solutions using the rclone command line or API.

Let rclone do the heavy lifting of communicating with cloud storage.

What can rclone do for you

Rclone can help you:

  • Backup (and encrypt) files to cloud storage
  • Restore (and decrypt) files from cloud storage
  • Mirror cloud data to other cloud services or locally
  • Migrate data to cloud, or between cloud storage vendors
  • Mount multiple, encrypted, cached or diverse cloud storage as a disk
  • Analyse and account for data held on cloud storage using lsfljsonsizencdu
  • Union file systems together to present multiple local and/or cloud file systems as one

Features

  • Transfers
    • MD5, SHA1 hashes are checked at all times for file integrity
    • Timestamps are preserved on files
    • Operations can be restarted at any time
    • Can be to and from network, eg two different cloud providers
    • Can use multi-threaded downloads to local disk
  • Copy new or changed files to cloud storage
  • Sync (one way) to make a directory identical
  • Move files to cloud storage deleting the local after verification
  • Check hashes and for missing/extra files
  • Mount your cloud storage as a network disk
  • Serve local or remote files over HTTP/WebDav/FTP/SFTP/dlna
  • Experimental Web based GUI

Supported providers

(There are many other providers, built on standard protocols such as WebDAV or S3, that work out of the box.)

Links