- Google Диск в качестве резервного хранилища для VPS сервера на базе Linux
- Как смонтировать Google Drive локально как виртуальную файловую систему в Linux
- 1. Google-drive-ocamlfuse
- Установка google-drive-ocamlfuse
- Использование
- 2. GCSF
- Установка GCSF
- Использование
- 3. Tuxdrive
- One thought on “ Как смонтировать Google Drive локально как виртуальную файловую систему в Linux ”
- Google Drive Client for Linux (2021)
- Mounting Google Drive on Linux
- Drive mounting options
- 1. ExpanDrive
- Download ExpanDrive
- Installation Instructions
- Desktop based installations
- Debian and Ubuntu based desktop distributions
- RHEL, Fedora, and CentOS based desktop distributions
- Server/Headless Edition
- Amazing Reviews
- 2. google-drive-ocamlfuse
- 3. GCSF
- Sync-Style clients
- 1. Insync
- 2. overGrive
- 3. Rclone
Google Диск в качестве резервного хранилища для VPS сервера на базе Linux
Пришла идея делать backup сервера VPS на CentOS 7 в Google drive, не пропадать же зря 15 гигам халявного места. Немного поискал и нашел пару статей на эту тему, тема оказалась не нова, и сначала поставил утилиту от самой корпорации добра, вот статья на эту тему Backing up a Directory to Google Drive on CentOS 7.
Но мне это не подходит, так как есть скрипт, который выполняется по расписанию, и в нем я решил проверять файлы по дате создания и не плодить миллион архивов, а для этого нужно смонтировать Google Drive в папку.
Утилита от Google умеет только закачивать и скачивать файлы, проверить по дате и удалить все старше 3х дней не получилось.
Спасение нашлось в google-drive-ocamlfuse, статей на эту тему не мало, но есть одно, но, утилита требует GUI интерфейс, а в частности любой браузер. В браузер передается с генерированная ссылка.
Google как известно авторизует пользователей по OAuth. В моем VPS естественно не о каком GUI речь не идет, только консоль.
На помощь пришла статья с github Headless Usage & Authorization. Предлагаю вам мой вольный перевод.
1. Устанавливаем по инструкции google-drive-ocamlfuse
2. Входим в свой google accaunt. Переходим на страницу https://code.google.com/apis/console/ и создаем Новый проект в верхнем левом углу (Project → Create project).
3. В левой панельке ищем Библиотеки-Drive API (Library → Drive API) и включаем её (Enable).
4. Дальше переходим на Учетные данные (Credentials). Создаем нового пользователя Create credentials → OAuth client ID. Выбираем Other в предложенных вариантах. Получаем ID и секретный ключ.
5. Возвращаемся в консоль и пишем:
6. Получаем сообщение в котором есть ссылка:
Копируем ссылку в браузер и получаем код верификации.
7. Копируем полученный код верификации и вставляем его обратно:
После этого будет создана папка с приложением (
/.gdfuse/me/), его мы и будем использовать для монтирование нашего диска. Монтируем в папку:
В оригинальной инструкции описаны действия которые нужно сделать при возникновении ошибок, но у меня все получилось с первого раза.
Источник
Как смонтировать Google Drive локально как виртуальную файловую систему в Linux
Google Drive является одним из популярных поставщиков облачного хранилища на планете.
По состоянию на 2017 год более 800 миллионов пользователей активно используют эту услугу по всему миру.
Несмотря на то, что за последнее десятилетие число пользователей резко возросло, Google еще не выпустил клиент для дисков Google для Linux.
Но это не остановило сообщество Linux.
Время от времени, некоторые разработчики принесли несколько клиентов для дисков Google для операционной системы Linux.
В этом руководстве мы увидим три неофициальных клиента диска Google для Linux.
Используя эти клиенты, вы можете монтировать Google диск локально как виртуальную файловую систему и получать доступ к вашим файлам дисков в вашем Linux-окне.
1. Google-drive-ocamlfuse
Google-disk-ocamlfuse является файловой системой FUSE Google Диск, написанной в OCaml.
Для тех, кто задается вопросом, FUSE означает файловую систему в пользовательском пространстве, это проект, который позволяет пользователям создавать виртуальные файловые системы на уровне пользователя. google-drive-ocamlfuse позволяет монтировать ваш Google Диск в системе Linux.
Он имеет доступ для чтения / записи к обычным файлам и папкам, доступ только для чтения к док-станции Google, листам и слайдам, поддержку нескольких учетных записей дисков Google, дублирование обработки файлов, доступ к вашему каталогу корзины накопителей и т. д.
Установка google-drive-ocamlfuse
google-drive-ocamlfuse доступен в AUR, поэтому вы можете установить его с помощью любых вспомогательных программ AUR, например Yay.
Чтобы установить последнюю бета-версию, выполните следующие действия:
Использование
После установки запустите следующую команду для запуска утилиты google-drive-ocamlfuse из вашего терминала:
Когда вы запускаете его в первый раз, утилита откроет ваш веб-браузер и попросит вас разрешить авторизовать файлы вашего диска Google.
После того, как вы предоставили авторизацию, все необходимые файлы конфигурации и папки, необходимые для установки вашего диска Google, будут автоматически созданы.
После успешной проверки подлинности в вашем терминале появится следующее сообщение.
Наконец, смонтируйте свой Google диск с помощью команды:
Вы можете получить доступ к своим файлам либо из терминала, либо из файлового менеджера.
Из диспетчера файлов:
Если у вас несколько учетных записей, используйте опцию label, чтобы различать различные учетные записи, например:
Как только вы закончите, отключите flesystem FUSE, используя команду:
Для получения дополнительной информации см. Справочные страницы.
2. GCSF
GCSF – файловая система FUSE на основе Google Диска, написанная с использованием языка программирования Rust.
Название GCSF произошло от румынского слова «Google Conduce Sistem de Fişiere», что означает «Файловая система Google Drive» на английском языке.
Используя GCSF, вы можете подключить свой Google диск как локальную виртуальную файловую систему и получить доступ к содержимому из терминала или файлового менеджера.
Вы можете задаться вопросом, как это отличается от других проектов Google FUSE FUSE, например google-drive-ocamlfuse
. Разработчик GCSF ответил на аналогичный комментарий Reddit «GCSF имеет тенденцию быть быстрее в нескольких случаях (перечисление файлов рекурсивно, чтение больших файлов с Диска).
Стратегия кэширования, которую он использует, также приводит к очень быстрым чтениям (улучшение x4-7 по сравнению с google-drive-ocamlfuse) для файлов, которые были кэшированы за счет использования большего количества оперативной памяти ».
Установка GCSF
GCSF доступен в AUR, поэтому пользователи Arch Linux могут установить его с помощью любого помощника AUR, например Yay.
Убедитесь, что установлены pkg-config и пакеты fuse.
Они доступны в репозиториях по умолчанию для большинства дистрибутивов Linux.
Например, на Ubuntu и производных вы можете установить их с помощью команды:
После установки всех зависимостей выполните следующую команду для установки GCSF:
Использование
Во-первых, нам нужно авторизовать ваш Google drive.
Для этого просто запустите:
Необходимо указать имя сеанса.
Замените mygoogledrive своим собственным именем сеанса.
GCSF создаст файл конфигурации в $ XDG_CONFIG_HOME / gcsf / gcsf.toml, который обычно определяется как $ HOME / .config / gcsf / gcsf.toml.
Учетные данные хранятся в одном каталоге.
После того, как вы прошли аутентификацию, смонтируйте свой Google диск с помощью команды:
Снова замените mygoogledrive своим именем сеанса.
Вы можете просмотреть существующие сеансы, используя команду:
Теперь вы можете получить доступ к своему содержимому диска Google либо из терминала, либо из диспетчера файлов.
Если вы не знаете, где установлен ваш Google диск, используйте команду df или mount, как показано ниже.
После этого отключите Google drive с помощью команды:
3. Tuxdrive
Tuxdrive – еще один неофициальный клиент для Google для Linux.
One thought on “ Как смонтировать Google Drive локально как виртуальную файловую систему в Linux ”
Гном умеет сам монтировать в наутилусе ГДрайв?, если ввести логин в “сетевых учетных записях” в настройках. Когда-то оттуда еще и цеплялись из диска и гуглофоточек фоточки в “Фото” их, но что-то там поломали и у меня по крайней мере не работает в самых разных дистрах.
Источник
Google Drive Client for Linux (2021)
Home » Google Drive » Google Drive Client for Linux
It’s 2021 and Google still doesn’t offer an official Linux client for Drive, and at this rate they might never. Thankfully there are many great options out there. We’re going to take a look at what is available.
There are three main types of clients:
- Mount Google Drive as a network drive
- Sync your Google Drive to a local folder
- Access Google Drive in an FTP-like interface for graphical transfer.
Mounting Google Drive on Linux
Mounting your GSuite account as a network filesystem is one of the best ways to access your files in the cloud. A network filesystem accesses your files on-demand, when you use them. This differs from a traditional sync-style client which mirrors remote content in a local folder.
On-demand access has huge benefits over a traditional sync-style client. First and foremost, it doesn’t pre-download any of your data, and files you aren’t using don’t take up valuable hard drive space. You access just what you need, when you need it. Google’s own Drive File Stream product replaced their sync client for business users for these very reasons.
Drive mounting options
On Linux like there are a few options available. Free open-source projects like google-drive-ocamlfuse or gcsf are designed for a more technical user or somebody who requires headless access.
These projects don’t come with some of the features you might expect if you’re used to operating on Mac or Windows and are generally not for the faint of heart. But they do work, and they are free.
There are also commercial options available such as ExpanDrive that do have a full desktop client with advanced features such as offline sync, background synchronization and many other powerful improvements over a standard network drive.
1. ExpanDrive
If you’re looking for a more powerful option to mount Google Drive on Linux ExpanDrive is a great option.
The ExpanDrive software has been available on Mac and Windows for over 10 years and has millions of users. Starting with ExpanDrive version 7 on a wide variety of Linux distributions including Ubuntu, Red Hat, Linux Mint, CentOS, Debian and most other popular distributions.
What makes ExpanDrive different are a variety of features to ensure a stable and high quality end-user experience.
ExpanDrive has multi-threaded background uploads, a full graphical user interface to facilitate bulk transfer, integrated search and version management along with much more. The main product page goes into detail on many of these features.
ExpanDrive supports personal Google Drive accounts as well as GSuite Drive accounts, including support for Team Drives. It securely connects to the Google Drive API and transparently supports ADFS and 2FA.
ExpanDrive runs We provide deb and RPM based installers and have an integrated auto-updater to help you stay up to date.
Download ExpanDrive
Installation Instructions
Desktop based installations
ExpanDrive ships primarily as a desktop app with a user interface for advanced configuration and management. We also have a server edition that runs headless for Windows and Linux Servers.
Debian and Ubuntu based desktop distributions
For Debian and Ubuntu based distributions the easiest way to get started is to download and install the latest .deb package (64 bit), either through the graphical installer or via the command-line with the following command.
Installing the .deb will also automatically install the apt repository and code signing key to enable easy update using the system package manager.
You can install the repository and key manually with the following script
Then you update the package cache and install ExpanDrive using:
RHEL, Fedora, and CentOS based desktop distributions
Download our latest .rpm package (64-bit) and use yum to install ExpanDrive and the required dependencies.
Installing the .rpm will also automatically configure the yum repository and code signing key to enable easy update using the system package manager.
You can install the yum repo manually using the following script:
Then update your package cache and install Expandrive using dnf (Fedora 22 and above):
Server/Headless Edition
Head over to our ExpanDrive Server Edition page for instructions and packages for Windows and Linux servers. ExpanDrive Server edition is designed to run unattended, at boot [versus login], and provides drives that can even be re-shared on the network.
Amazing Reviews
“ExpanDrive lets you mount remote sftp drives and it actually works! I.e. no long delays or dropped connection in the middle of a save.”
“My first impression after reading ExpanDrive’s promotional description last week was that it sounded too good to be true. One week later, I’m pretty sure it actually is that good.”
John Gruber, Daring Fireball
ExpanDrive connects your files as a fast network drive and accesses all of your data on demand. You can browse and open any file from within your file manager or from the command-line. ExpanDrive builds native access to Google Drive into Linux.
2. google-drive-ocamlfuse
google-drive-ocamlfuse is probably the most popular and actively maintained open source option to mount Google Drive [GCSF is no longer being active developed].
It’s written in OCaml and is designed to be run from the command-line. There are deb packages maintained by the author, but beyond that you’re own your own. Checkout the project github page for instructions on how to install.
Once you’ve installed google-drive-ocamlfuse you start the authentication process by running
This command sets up the default configuration directory in
/.gdfuse/default and launches your system browser to do an oauth authentication to get the API key. Now perform the filesystem mount by simply running:
mountpoint is the absolute path to your intended mountpoint in the filesystem. Google-drive-ocamlfuse supports multiple accounts via the -label command-line option, letting you mount different labels to different mountpoints. Run the fusermount -u command to perform an unmount.
3. GCSF
GCSF is another FUSE based project that runs on Linux (and Mac) that runs a fairly similar manner to google-drive-ocamlfuse. Th primary author, Sergiu Pușcaș spun the project out of his diploma thesis and remains the primary author. In the spirit of developing in trendy languages, GCSF is written in Rust. Sergiu notes, as of April 2019 that he has very little time to dedicate to the project. It is definitely still maintained, but perhaps not under active development anymore. If you’re looking for details on how to try it out, check his github project page.
Sync-Style clients
There are many more open-source sync style clients available on Linux for Google Drive. Most of them have fairly dubious levels of quality and support. There are also some more polished commercial options available as well.
1. Insync
Insync is the most feature-rich sync client for Google Drive on Linux. The user interface runs out of your system tray and is fairly similar to other desktop sync clients on Mac and Windows. It offers support for multiple accounts and selective sync. It is a $49.95 one-time license fee to get all the features.
2. overGrive
You can think of overGrive like a less expensive version Insync. It only costs $4.95 and comes with a few extra features, like back-only, and converting Google Docs to office files for offline editing.
3. Rclone
Rclone is a free open-source app that bills itself as rsync for cloud storage, which is a reasonable approximation of how this works. Rclone is designed as a command-line utility to push and pull data from the cloud, rather than a continuous sync solution like overGrive or Insync. It support a huge array of cloud storage back-ends, which is certainly nice to have.
in Boston. ©2004-2021 ExpanDrive, Inc.
Источник