0

I use grive to sync folder with Google drive in Ubuntu, but I want to set a bandwidth limit on grive sync.

I use this command for sync in 50 kbytes speed limit:

grive -p /home/purval -U 50 -D 50  

but it's not working.even not showing any error message.My grive version is grive version 0.5.1-dev

  • When describing a problem, simply telling us "it's not working" is not helpful. How is it failing? Any error messages? Does the command not run? Does it run but crash? Does it run but do nothing? How are you checking the bandwith use? Please edit your question and tell us more about what you are doing. – terdon Mar 22 '17 at 11:20
0

By default grive installation from github, upload & download speed parameters would not work even if you pass -U 50 or -D 50 , grive will use max upload / download bandwidth of your system.

Grive is using CURL under its hood for file transmission and there is parameter in curl which can control bandwidth while transmission i.e (curl_off_t) details here.

DESCRIPTION

Pass a curl_off_t as parameter with the maxspeed. If an upload exceeds this speed (counted in bytes per second) the transfer will pause to keep the speed less than or equal to the parameter value. Defaults to unlimited speed.

There is file named grive/libgrive/src/http/CurlAgent.cc in source code which contains

CURLOPT_MAX_SEND_SPEED_LARGE with mMaxUpload

as option for upload, mMaxUpload is the value in kbps which set by using grive with -U 50 and

CURLOPT_MAX_RECV_SPEED_LARGE with mMaxDownload

as option for download, mMaxDownload is the value in kbps which set by using grive with -D 50

to control bandwidth just add (curl_off_t) like

static_cast<curl_off_t>( mMaxUpload ) instead of only mMaxUpload & static_cast<curl_off_t>( mMaxDownload ) instead of only mMaxDownload in above file & save it.

After saving file, compile the source code & run it as described in repository & after successful compilation you can now set upload & download bandwidth by -U 50 / -D 50 where 50 is kbps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.