By adding grive to crontab, periodic backups of important folders can be made. And no user interaction is required because the process is automated. Here is how to do it in Ubuntu. There is no system load when the process is not running, but this comes with a disadvantage: no filesystem monitoring. Any updates are made during the automatic execution of Grive.
sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install griveNow choose a directory to backup. You must have read/write permissions. I recommend Documents folder. Unfortunately, only one folder can be chosen for backup. While in Terminal cd to that directory. If it is Documents, run cd ~/Documents. Now run Grive: grive -a. The -a argument tells Grive to request the authorization code from Google. This is what you'll see in Terminal:
Whenever you want to do a manual synchronization you can use one of the methods:
- cd to the folder you backup and simply run grive.
- run grive in any folder with an argument: grive --path /home/<username>/Documents.
Grive won't do backups unless you run it. But being a CLI application which requires no user input to start the backup it can be run from a scheduled task. Instead of manually editing the crontab file, I chose the GUI solution: GNOME Schedule. Install it with sudo apt-get install gnome-schedule. Run it from Dash or from Terminal (gnome-schedule). On the main window, click the drop-down arrow next to New and add a Recurrent Task.
Make it run every week (or how often you want). The command is:
grive --path /home/<username>/Documents
Click the Add button. Now, to test the task, click the Run button in the main window and ignore any warnings.
If you see something like in the below screenshot, everything worked good.
If Grive starts synchronizing again all files and uploads other files than you know you have in the selected folder, it means you got the path wrong. Check again the command and use absolute paths.
Now that everything works, you might want to suppress output from Grive. Edit the task as follows:
- Grive usage: http://www.lbreda.com/grive/usage
- Grive installation on WebUpd8: http://www.webupd8.org/2012/05/grive-open-source-google-drive-client.html
- Crontab information on Ubuntu Community Help Wiki: https://help.ubuntu.com/community/CronHowto
- GNOME Schedule homepage: http://gnome-schedule.sourceforge.net/
- Grive2: Grive Fork With Google Drive Rest API and Partial Sync Support [PPA]: http://www.webupd8.org/2015/05/grive2-grive-fork-with-google-drive.html