Skip to content
Edtigoza edited this page Jul 9, 2016 · 34 revisions

Welcome to the drive wiki!

System pre-requisites for Drive:

  • An installation of Go with version >= 1.3

    To check your go version:

    $> go version

  • Your gopath should have been set in your e.g

    Sample set up:

    vi ~/.bashrc or vi ~/.bash_profile

    export GOPATH=~/gopath

    export PATH=$GOPATH:$GOPATH/bin:${PATH}

Installing drive, the program:

$> go get -u github.com/odeke-em/drive/drive-gen && drive-gen

Env variables:

To manage the number of concurrent pulls/pushes in your env make sure to set variable DRIVE_GOMAXPROCS e.g:

$ cat << ! >> ~/.bashrc
> export DRIVE_GOMAXPROCS=8
> !
$ source ~/.bashrc

Linux Terminal Character Encoding:

If the spinner under Resolving... displays diamonds with question marks in them, your linux terminal is not displaying UTF-8 characters. Fix by defining LANG either in each user session or system-wide. It can be defined system-wide in /etc/environment or /etc/locale.conf. For example, in the United States, here is what /etc/environment would look like after editing it:

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
LANG=en_US.UTF-8

It may be easier to put it in /etc/locale.conf using localectl as follows:

sudo localectl set-locale LANG=en_US.UTF-8

The system-wide locale can be overridden in each user session by creating or editing ~/.config/locale.conf.

After a reboot, your linux terminals should display all the characters instead of putting diamonds with question marks on the screen. If not, it could be that the locale was not generated. To generate a locale, first uncomment the corresponding line in /etc/locale.gen, save it, and sudo locale-gen. Another reboot should have it working properly.

Working in a cronjob with or without root

 #Method one

 $GOPATH/bin/drive push -quiet /your_mountpoint_here/
 $GOPATH/bin/drive pull -quiet /your_mountpoint_here/

 #Method two
 # find your $GOPATH installation 
 $ cd $GOPATH
 $ pwd
 
 /path_GOPATH/bin/drive push -quiet /your_mountpoint_here/
 /path_GOPATH/bin/drive emptytrash -quiet /your_mountpoint_here/
 
 #EXAMPLE $GOPATH in folder /var/go/

 /var/go/bin/drive push -quiet /your_mountpoint_here/
 /var/go/bin/drive emptytrash -quiet /your_mountpoint_here/