- Лучшие клиенты Google Drive Linux
- Лучшие клиенты Google Drive Linux
- 1. GoSync
- 2. Grive2
- 3. Rclone
- 4. CloudCross
- 5. Drive
- 6. DriveSync
- 7. Сетевые аккаунты GNOME
- 8. Gdrive
- 9. Tuxdrive
- 10. Google-drive-ocamlfuse
- Выводы
- Linux upload file to google drive
- Uploading files to Google Drive directly from the Terminal (using Curl)
- An alternative method of pushing data from a computer to the cloud.
- Installation
- Create your project credentials
- Google Cloud Platform
- Google Cloud Platform lets you build, deploy, and scale applications, websites, and services on the same infrastructure…
- Now we need to verify the device
- Get Bearer code
- Upload files
- Wrap it all up in a script
- Conclusions
- Daniel Ellis
Лучшие клиенты Google Drive Linux
Google Диск — одно из лучших облачных хранилищ, предлагающее достаточно свободного места для хранения документов, фотографий и вложений Gmail. Популярность Диска растет день ото дня, и можно предположить, что вскоре он полностью вытеснит физические накопители. Поэтому, вместо того, чтобы сохранять файлы по старинке, лучше учиться работать с новыми технологиями. Более того, используя облачное хранилище, можно не переживать о сохранности ваших драгоценных файлов и документов. Google предлагает официальный клиент для работы с Диском под все преобладающие ОС, кроме Linux. Но существует множество альтернатив для работы с ним, которые без труда справляются со своей задачей.
В этой статье, мы собрали лучшие клиенты Google Drive Linux. Может показаться, что этот перечень достаточно длинный, но я хочу, чтобы у вас было из чего выбрать и найти именно то, что подходит для вас. Поэтому, прежде чем останавливаться на конкретной программе из этого списка, сначала установите и проверьте все предложенные варианты. Так вы увидите, соответствует клиент вашим требованиям или нет.
Лучшие клиенты Google Drive Linux
1. GoSync
GoSync — еще один лучший клиент Google Диск для Linux. Он написан на языке программирования Python и предлагает простой в использовании графический интерфейс. Подобно аналогам он позволяет синхронизировать файлы и документы между локальным и удаленным хранилищем. Если вы вносите какие-либо изменения локально или удаленно, он автоматически синхронизируется с обеих сторон. При желании, вы можете приостановить или возобновить синхронизацию.
2. Grive2
Возможно, вы слышали о Grive — еще одном клиенте для Google Диска. На данный момент проект полностью заброшен, но Grive2 — это еще одна интерпретация Grive, которая может стать его достойной заменой. Она поддерживает новый API Drive REST и частичную синхронизацию.
3. Rclone
Rclone — это бесплатный и синхронизируемый клиент облачного хранилища на основе CLI с открытым исходным кодом для всех основных ОС, включая Windows, Linux, Mac OS, FreeBSD и т. д. Нельзя сказать, что это просто клиент для работы с Google Drive на Linux. Скорее это программа, позволяющая синхронизировать файлы и документы с несколькими облачными онлайн-хранилищами, включая Google Диск, Amazon S3, OneDrive, Dropbox, Mega, Box и т. д.
4. CloudCross
CloudCross — кроссплатформенный клиент Google Диска с открытым исходным кодом для Linux, Windows и Mac OS. Основной функционал предоставляет возможность синхронизации файлов и документов между локальными и различными удаленными облачными хранилищами. На данный момент поддерживаются Google Drive, Dropbox, OneDrive, Mail.Ru и Яндекс.Диск.
5. Drive
Drive — это инструмент, работающий из под командной строки для скачивания или загрузки файлов Google Диска. Он написан на языке программирования Go и не предлагает слишком много возможностей. Здесь нет функций фоновой синхронизации и он вряд ли сгодится для использования новичками.
6. DriveSync
DriveSync также представляет инструмент для работы из под командной строки для синхронизации файлов и документов Google Диска с вашим компьютером. Вы без труда сможете скачивать недавно добавленные файлы из удаленного хранилища, добавлять папки в черный и белый список синхронизации и многое другое. Он вполне сгодится в качестве лучшей альтернативы официальному клиенту Google Диска для Windows или Mac OS. На данный момент это один из лучших клиентов Google Диска для Linux.
7. Сетевые аккаунты GNOME
Хорошая новость для тех, кто использует Gnome Desktop — в нем поддерживается встроенный клиент Google Диском. Для работы с ним в настройках в разделе с аккаунтами нужно добавить учетную запись Google, после чего вы сможете загружать, синхронизировать, копировать и удалять файлы прямо в файловом менеджере Nautilus. Программа не сможет полностью заменить клиент Google Диска для Linux, но с базовыми функциями она справится без труда.
8. Gdrive
Gdrive — популярный CLI-клиент Google Drive для Linux, который часто используется для взаимодействия с облачным хранилищем для зашифрованного резервного копирования файлов.
9. Tuxdrive
В системе Linux удобно и не сложно использовать терминал. На рынке доступно множество клиентских программ для Google Диска с графическим интерфейсом, но консольных приложений намного меньше. Представляем вам Tuxdrive CLI-клиентом Google Диска для Linux. Используя этот инструмент, вы можете получить доступ к файлам и документам Google Диска, загружать или скачивать файлы и использовать другие функции облачного хранилища.
10. Google-drive-ocamlfuse
Этот клиент для работы с облачным хранилищем Google обладает необходимыми функциями, включая доступ к файлам и папкам, корзине, а также использование Документов Google в режиме только чтение. Это CLI-клиент, который поддерживается самой Google, позволяющий работать с несколькими учетными записями и монтировать Google Диск на Linux.
Выводы
Как это не прискорбно, но Google до сих пор ни создала ни одного официального приложения для работы с Google Drive на Ubuntu или других дистрибутивах Linux. Однако стороннее программное обеспечение предоставляет множество возможностей для работы с этим облачным хранилищем.
В этой статье мы рассмотрели лучшие клиенты Google Drive Linux, каждый из которых, имеет свои сильные и слабые стороны. Невозможно выделить, какой клиент Google Диска является самым лучшим, поскольку это в большей степени зависит от требований отдельных пользователей. Как мы увидели, у нас есть из чего выбрать: существуют клиенты, как с графическим интерфейсом, так и те, что можно использовать с помощью командной строки.
А какая программа из этого списка больше всего нравится лично вам? Или может быть мы упустили какой-то другой удобный клиент Google Диска? Расскажите нам о своем опыте в комментариях ниже. И не забудьте поделиться этой статьей в социальных сетях. Спасибо, что вы с нами.
Источник
Linux upload file to google drive
gdrive is a command line utility for interacting with Google Drive.
gdrive is finally verified for using sensitive scopes which should fix the This app is blocked error. Note that the project name will show up as project-367116221053 when granting access to you account. (I don’t dare to change any more settings in the google console.)
None, binaries are statically linked. If you want to compile from source you need the go toolchain. Version 1.5 or higher.
Download gdrive from one of the links in the latest release. The first time gdrive is launched (i.e. run gdrive about in your terminal not just gdrive ), you will be prompted for a verification code. The code is obtained by following the printed url and authenticating with the google account for the drive you want access to. This will create a token file inside the .gdrive folder in your home directory. Note that anyone with access to this file will also have access to your google drive. If you want to manage multiple drives you can use the global —config flag or set the environment variable GDRIVE_CONFIG_DIR . Example: GDRIVE_CONFIG_DIR=»/home/user/.gdrive-secondary» gdrive list You will be prompted for a new verification code if the folder does not exist.
Compile from source
The gdrive binary should now be available at $GOPATH/bin/gdrive
Gdrive supports basic syncing. It only syncs one way at the time and works more like rsync than e.g. dropbox. Files that are synced to google drive are tagged with an appProperty so that the files on drive can be traversed faster. This means that you can’t upload files with gdrive upload into a sync directory as the files would be missing the sync tag, and would be ignored by the sync commands. The current implementation is slow and uses a lot of memory if you are syncing many files. Currently only one file is uploaded at the time, the speed can be improved in the future by uploading several files concurrently. To learn more see usage and the examples below.
For server to server communication, where user interaction is not a viable option, is it possible to use a service account, as described in this Google document. If you want to use a service account, instead of being interactively prompted for authentication, you need to use the —service-account global option, where serviceAccountCredentials is a file in JSON format obtained through the Google API Console, and its location is relative to the config dir.
Placing a .gdriveignore in the root of your sync directory can be used to skip certain files from being synced. .gdriveignore follows the same rules as .gitignore, except that gdrive only reads the .gdriveignore file in the root of the sync directory, not ones in any subdirectories.
Upload file or directory gdrive [global] upload — [options] Upload file from stdin gdrive [global] update [options]
Update file, this creates a new revision of the file gdrive [global] info [options] Show file info gdrive [global] mkdir [options] Create directory gdrive [global] share [options] Share file or directory gdrive [global] share list List files permissions gdrive [global] share revoke
Revoke permission gdrive [global] delete [options] Delete file or directory gdrive [global] sync list [options] List all syncable directories on drive gdrive [global] sync content [options] List content of syncable directory gdrive [global] sync download [options]
Sync drive directory to local directory gdrive [global] sync upload [options]
Sync local directory to drive gdrive [global] changes [options] List file changes gdrive [global] revision list [options] List file revisions gdrive [global] revision download [options] Download revision gdrive [global] revision delete Delete file revision gdrive [global] import [options]
Upload and convert file to a google document, see ‘about import’ for available conversions gdrive [global] export [options] Export a google document gdrive [global] about [options] Google drive metadata, quota usage gdrive [global] about import Show supported import formats gdrive [global] about export Show supported export formats gdrive version Print application version gdrive help Print help gdrive help Print command help gdrive help Print subcommand help «>
List file in subdirectory
Download file or directory
Download path —delete Delete remote file when download is successful —no-progress Hide progress —stdout Write file content to stdout —timeout Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300 «>
Download all files and directories matching query
Download path —no-progress Hide progress «>
Upload file or directory
Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents —name Filename —description File description —no-progress Hide progress —mime Force mime type —share Share file —delete Delete local file when upload is successful —timeout Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300 —chunksize Set chunk size in bytes, default: 8388608 «>
Upload file from stdin
Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents —chunksize Set chunk size in bytes, default: 8388608 —description File description —mime Force mime type —share Share file —timeout Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300 —no-progress Hide progress «>
Update file, this creates a new revision of the file
Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents —name Filename —description File description —no-progress Hide progress —mime Force mime type —timeout Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300 —chunksize Set chunk size in bytes, default: 8388608 «>
Parent id of created directory, can be specified multiple times to give many parents —description Directory description «>
Share file or directory
List files permissions
Delete file or directory
List all syncable directories on drive
List content of syncable directory
Width of path column, default: 60, minimum: 9, use 0 for full width —no-header Dont print the header —bytes Size in bytes «>
Sync drive directory to local directory
Sync local directory to drive
List file changes
Page token to start listing changes from —now Get latest page token —name-width Width of name column, default: 40, minimum: 9, use 0 for full width —no-header Dont print the header «>
List file revisions
Download path —timeout Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300 «>
Delete file revision
Upload and convert file to a google document, see ‘about import’ for available conversions
Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents —no-progress Hide progress «>
Источник
Uploading files to Google Drive directly from the Terminal (using Curl)
An alternative method of pushing data from a computer to the cloud.
Sep 14, 2020 · 4 min read
In many cases, it may be difficult to send data from a new machine to another. Examples of this include HPC facilities which are hidden behind a login portal but do not allow ssh tunnelling or simple headless machines which only have a few core programs installed. In this article, we look at using cURL (a command-line program for transferring data) to push a zipped file (containing log files) onto our google drive account for further analysis.
Installation
Most machines will come with cURL installed (try typing which curl ). If this is not the case we can install it with
Now we have it installed, we can look at creating the credentials needed to send files.
Create your project credentials
As we are allowing access to our google drive, we want to be able to manage this. This is done by creating a project with user-defined permissions to act as the proxy between our users (in this case us on a different machine) and our account. We start by going to the following page (link below) and creating a new project.
Google Cloud Platform
Google Cloud Platform lets you build, deploy, and scale applications, websites, and services on the same infrastructure…
After this has been done we select the Credentials tab (on the left) and “create credentials” from the top.
When asked for the app type, we select TV and other.
Finally, this generates a client id and a client seacret .
This is your username and password so copy it somewhere secure.
Now we need to verify the device
To do this we ssh into the machine we wish to upload from and run the following command:
Doing so we get a response in the following format
Here we need to visit the URL (https://www.google.com/device) and provide the user code to complete our verification. We now continue to select our google account and grant the relevant permissions. When doing this make sure to note down the device code for the next step.
Get Bearer code
When we start uploading, this is the code we shall need to use to identify our account. We get it by using the following:
The client id and secret are saved from the first step, and the device code in the previous section. The output should be in the format:
Write down the access_token as it will be needed in the upload stage.
Upload files
The command we use to upload files is given below
Here you may need to enable the app API before being allowed to upload data. The link to do this is given in the error message if this is the case.
Here multipart files are expected to only be a couple of MB in size. However if you are looking at moving larger files resumable may be better suited (see https://developers.google.com/drive/api/v3/manage-uploads )
Wrap it all up in a script
Now we know our commands work we can create an executable script to do all the work for us. Here we can provide a group of files, it zips them up and then sends them to google drive.
We start by creating a new file with nano curlgoogle; and enter the following code — remember to add your own personal auth token! Python 2.7 has been chosen as this is still the default python version on older systems, however the script below should also run for python 3.
It should require no new dependencies provided curl already exists on the system.
We then make it executable chmod a+x curlgoogle allowing us to use it in an executable manner:
Conclusions
And there we have it, an easy way to send multiple log files from a headless machine to a google drive repository, which can be accessed by multiple people for analysis.
If you are in need of more information, stack overflow answers by Tanaike and HAKS (amongst others) were particularly helpful in creating this post.
Daniel Ellis
Research Software Engineer specialising in Data Visualisation with a touch of HPC. — PhD in Atmospheric Chemistry and Masters in Theoretical Physics.
Источник