- DriveSync — Sync Local Files with Google Drive from Linux CLI
- Features
- Installation
- 1. Install Ruby
- 2. Install DriveSync
- How to use
- Configuration
- Automatic synchronization
- How to Use Google Drive on Ubuntu Linux
- 1) Ubuntu GNOME built-in Method
- Step 1. Installing GNOME Online Accounts feature
- Step 2. Launching GNOME Online Accounts Feature
- 2) Using google drive ocamlfuse
- Features
- Installing Google Drive Ocamlfuse on Ubuntu 18.04
- 3) Insync
- 4) Rclone
- Installation
- Configuring Rclone
- How to install & use the Google Backup and Sync on Ubuntu
DriveSync — Sync Local Files with Google Drive from Linux CLI
DriveSync is a command-line utility that synchronizes the local files in your computer with Google Drive. It provides a simple and efficient method to keep your files organized and backup them to be accessed remotely.
Features
- Download remote files
- Upload local files to Google Drive
- Delete or update files both locally and on Drive
- Able to Ignore selected files
- Able set file size thresholds
- Automate using cron job
Installation
First of all, you need to have Ruby 2.x installed. The software is officially tested and developed with 2.3.0 and 2.1.2.
You can check the installed version by typing:
1. Install Ruby
If you don’t have Ruby installed, just install it:
Ubuntu
Arch Linux
Fedora
2. Install DriveSync
Now it’s the same in every distribution, execute this lines (separately):
And that’s it! You can now run DriveSync by typing:
How to use
When you run the program, it’ll give you a URL, like this one (I’ve hidden the id for security reasons):
Then, paste the URL in your browser and you’ll get the authorization code. Copy that code and paste it in your open terminal as it is. Then press Enter:
Now, DriveSync will start to synchronize your computer with Google Drive, so it may take some time.
Configuration
All the software settings are located in a config.yml file. It’s located in pathToDrivesync /config.yml. For example, as I have DriveSync installed on /home directory, the path should be: drivesync/config.yml
That config file has all the settings explained. As the official documentation says, the most important configuration at the beginning is the location for the drive folder in your local system. You can set it as you like.
Automatic synchronization
It’d be better to synchronize your files automatically than doing it manually by adding to cron job. This is possible by following these steps:
Type in a terminal:
You’ll be asked what text editor do you want to use. Choose the one that you prefer, in this case I chose nano.
Then paste this line:
It should be something like this:
Save the file and close.
The developer doesn’t advise syncing large files. DriveSync ignores by default any file above 512MB. This can be changed in the config file, and you may have to change the timeout threshold too (in the same file).
Google Drive allows files or folders with identical paths, while Linux doesn’t. So try not to have identical paths. Also, DriveSync ignores Google Docs files, but there may be a fix in the future. You can go to the official repository and read more documentation.
Источник
How to Use Google Drive on Ubuntu Linux
Its now 2020 and we are still waiting for official google drive client from google, but we have few clients that work flawlessly.
In this tutorial, we’ll focus on how to use Google Drive on Ubuntu 18.04. Ready? Let’s dive in and see how this can be seamlessly achieved.
1) Ubuntu GNOME built-in Method
Step 1. Installing GNOME Online Accounts feature
To start off, log in to your system as the root user or as a regular user with root privileges. Next, run the command below to install the Google Online Accounts feature.
Step 2. Launching GNOME Online Accounts Feature
Once successfully installed, start GNOME Online Accounts by running
This will launch the Online Accounts Window as shown. Thereafter, click on ‘Google‘
This will prompt you for your email address. Type it in and hit Enter.
Next, provide your Account’s password as shown and click on ‘Next‘ or hit Enter.
The next Window, will display the all the features from your Account that GNOME wants to access.
Scroll to the bottom and Click on ‘Allow’
By default, all the features as shown below will be synched. You can choose either to turn the Sync functionality OFF or ON. For best practice, leave the default settings as they are.
Great! We are all set! You can access your Google Drive folder using Nautilus File Manager commonly known as Files.
The drive folder can also be accessed by double-clicking on the mounted partition located on your GNOME’s desktop as shown below.
It is important to note that when using the GNOME Online Accounts feature, Drives files will not be stored locally.
2) Using google drive ocamlfuse
Ocamlfuse is a FUSE-based file system backed by Google Drive. It is written in OCaml and lets you mount your Drive folder on your Linux System and gives you access to your files and folders, either via command line or GUI file manager.
Features
Below is a summary of some of the ocamlfuse features
- Provides support for multiple accounts
- Provides support for Symbolic links
- Can handle duplicate files
- Grants access to the trash directory
- Maintains UNIX permissions and ownership
- Handles read-only access to Google Docs — Sheets, Slides
- Provides full read/write access to ordinary files and folders
Installing Google Drive Ocamlfuse on Ubuntu 18.04
To install the Ocamlfuse run the following commands in that order
Once successfully installed, authorize google-drive-ocamlfuse client with your desired Google account using the following command.
This is going to pop open a page on your browser where will request you to choose a Gmail account to continue with the setup
Next, Gdfuse will request access to your account.
Click on the ‘Allow’ button to allow google-drive-ocamlfuse to access your Drive.
You’ll then be prompted for your password
You will then be asked to choose the account to use
Finally, create a mount point in your home directory and mount the directory
To verify the creation and mounting of the directory, run
using Nautilus, you can click on File on the Menu and be sure to find a Google drive option at the bottom. Click on it and wait for a few seconds for file synchronization to begin. After a short while, you’ll have access to all your files.
3) Insync
Insynch is a paid, powerful cross-platform GUI client tool that adds drive functionality to your Linux desktop. Some of the features include:
- Handling of multiple accounts
- Gmail support
- G-Suite support
- Sync on Demand
- On-demand synching of shared files
- Desktop Notifications
- Provides a common-line for Linux
- Support for Raspberry Pi
- Merging folders
- Support for symlinks
To install Insync head out to Isync’s Official download page and select your System’s distribution. For this case, we will download the Debian package for Ubuntu 18.04. as shown
Select accordingly your Operating System, version and architecture and click on ‘Download’. This will download the Debian package for Ubuntu 18.04 version
Once the Debian package, install Insync by opening the terminal, navigating to the folder containing the Debian package and run
Upon successful installation, Launch the Search Menu, search for the application and launch it.
This will pop open the Insync Window below. Click on ‘Add a Google Account’
This will open a browser page where will ask for your email-id. Provide your email and click ‘Next’.
Next, you will be prompted for your password. Once you’ve keyed in your password hit on ‘Next’
Here, you will be required to Allow Insync to makes changes to your Drive account
Scroll down and hit ‘Allow’
Nautilus integration with Google Drive will thereafter commence.
Click on ‘Yes’ to integrate Insync with Nautilus
Select your preferred pricing
Synching of files will begin
4) Rclone
Rclone is a command line tool used for synchronizing files and directories from a myriad of cloud service. These include DropBox, Amazon S3, Google Drive, OneDrive Nextcloud and many more.
Now, let’s see how we can install Rclone.
Installation
We’ll install Rclone from a precompiled binary. To do this, open a terminal window and issue the following commands:
First, download the rclone zip file using the curl command
Next, unzip the rclone zipped file
Navigate into the file
Now, copy the binary file and give it the proper permissions with the following commands:
Finally, install the manpage with the commands:
Configuring Rclone
Next, we will set up Rclone to sync to Google Drive.
To configure rclone, issue the command:
You will be required to select the type of storage you’d want to configure. Select the appropriate number corresponding
You will be asked a number of questions, most of which are self-explanatory.
The only questions that might give you a headache are
To all of the above, just hit Enter.
For the Value «scope» = you can provide whatever name you want. By default, it will be drive. You can leave that or type something more meaningful.
Eventually, your default browser will pop open, prompting you to select which Google account you’d like to use. If at this point you’ve not already signed into your account, you’ll be required to do so at this point. Once that completes, answer a few more simple questions and then quit the configuration script. Your connection is now set up.
Allow rclone to access your account by clicking on the «Allow» button
You’ll get the following confirmation that it has been successful.
To copy a file to Google-drive using rclone command type
Drive-CLI is another command line utility tool for drive to access, sync, download, upload directly to your drive. We hope that this tutorial has been helpful. Go ahead and try out some tools and let us know what your experience was! Your contribution will be appreciated.
Источник
How to install & use the Google Backup and Sync on Ubuntu
Cloud storage is really one of the safest and efficient ways of storing numerous files. Multiple options are available for choosing the most appropriate cloud storage, but Google is the favourite for most users, as a single account can give you access to almost everything from the most reliable search results to mail services, which even include the Play Store, and some nifty other services like Google Keep, Google Docs, and what not. You can even download Google Drive on your smartphone and PC to sync files easily on the cloud and access it from everywhere, without the need of opening Google Drive on the web and upload or download them manually.
But in spite of Google Drive being such a mature cloud storage platform, the unavailability of the Google Drive app on Linux is a big drawback. That is a deal breaker for most users who want to ditch Windows and move to Linux. But in spite of the unavailability of the official app, you can use Google Drive for Linux Mint or can use Google Backup and Sync on Linux quite effortlessly with the Google Drive API on Linux, with the help of Gnome. You will be able to access Google Drive as a network drive, which means you can save files directly to it, or open a file from it with minimum hassles. You will have to tinker around with the Linux command line, but trust me, it will be short. To get Google Drive for Linux and Ubuntu, you will just need a single command.
So let’s get started with the tutorial. I will be showing this tutorial on Ubuntu Linux which is no doubt the most popular distribution of Linux, liked by many.
Источник