[plugin] Traffic Limits

Suggest, post, or discuss plugins for Deluge
mavit
New User
New User
Posts: 5
Joined: Mon Nov 08, 2010 3:05 am

[plugin] Traffic Limits

Postby mavit » Fri Nov 12, 2010 8:24 pm

TrafficLimits is a Deluge plugin to pause all torrents if more than a set amount of data is uploaded or downloaded.

Downloads
Source code, bug reports, etc.

From the README:
Configuration:


As well as setting the limits through the preferences (GTK UI only, for now), you can also create a file called `~/.config/deluge/trafficlimits` containing a label, the upload limit, and the download limit (in bytes), each on a line by themselves. For example:

Code: Select all

January
-1
21474836480

This is intended to be used by a cron job for automatic scheduling, e.g.,

Code: Select all

* 00-15,21-23 * * * /bin/echo -e "Unlimited\n-1\n-1"             > ${XDG_CONFIG_HOME:-~/.config}/deluge/trafficlimits.tmp && mv ${XDG_CONFIG_HOME:-~/.config}/deluge/trafficlimits.tmp ${XDG_CONFIG_HOME:-~/.config}/deluge/trafficlimits
* 16-20       * * * /bin/echo -e "Evening\n400000000\n750000000" > ${XDG_CONFIG_HOME:-~/.config}/deluge/trafficlimits.tmp && mv ${XDG_CONFIG_HOME:-~/.config}/deluge/trafficlimits.tmp ${XDG_CONFIG_HOME:-~/.config}/deluge/trafficlimits

See also:

Please see also the Toggle plugin. You will need this to resume transfers once they have been paused, unless you use the automatic scheduling.
Last edited by mavit on Sun May 19, 2013 1:58 pm, edited 1 time in total.

loki
Compulsive Poster
Compulsive Poster
Posts: 787
Joined: Tue Dec 04, 2007 3:27 pm
OS or Distro: Win7 x64 Ultimate
Location: MI, USA
Contact:

Re: [plugin] Traffic Limits

Postby loki » Sat Nov 13, 2010 4:41 am

Could be very useful, for instance, people that have a monthly limit or pay by the byte...

SpmP
Member
Member
Posts: 11
Joined: Thu Jul 08, 2010 3:13 am

Re: [plugin] Traffic Limits

Postby SpmP » Sun Dec 19, 2010 2:33 am

I need some help on how to use this plugin.
My situation is this:
During the day its par per gig,
Then at night I get some free bandwidth which is up and down combined.

I use the schedulere plugin to run deluge at night, but sometimes I dl stuff during the day using the toggle plugin.

What I want is that traffic is monitored and limited during the nightime part only. Cron is great, no probs there, I just dont understand the sample provided, sorry.

deluged is on the house server, accessed via deluge-gtk on local network.

TIA

mavit
New User
New User
Posts: 5
Joined: Mon Nov 08, 2010 3:05 am

Re: [plugin] Traffic Limits

Postby mavit » Sun Dec 19, 2010 12:09 pm

SpmP wrote:What I want is that traffic is monitored and limited during the nightime part only. Cron is great, no probs there, I just dont understand the sample provided, sorry.


Add a cronjob that runs at the start of the evening. Have it create a file called ~/.config/deluge/trafficlimits with the following contents:

Code: Select all

Nighttime
<upload limit in bytes>
<download limit in bytes>

Then add a second cronjob that runs at the start of the day, overwriting the file with the following. This will reset the counters and make both upload and download unlimited.

Code: Select all

Daytime
-1
-1

Make sure the cronjobs run on the server box, not one of your clients.

Hope this makes more sense.

SpmP
Member
Member
Posts: 11
Joined: Thu Jul 08, 2010 3:13 am

Re: [plugin] Traffic Limits

Postby SpmP » Sun Dec 19, 2010 9:07 pm

mavit wrote:Add a cronjob that runs at the start of the evening. Have it create a file called ~/.config/deluge/trafficlimits with the following contents:

Code: Select all

Nighttime
<upload limit in bytes>
<download limit in bytes>

Then add a second cronjob that runs at the start of the day, overwriting the file with the following. This will reset the counters and make both upload and download unlimited.

Code: Select all

Daytime
-1
-1

Thanks Mavit,

I need monthly accounting, how can I avoid resetting the counter, or save the counter to a file (then reload).

My ISP counts traffic, up and down summed together... total traffic (ie up+down) be used , or a provision made for it in your code?
ie:
label
up limit
down limit
total limit

or implied total limit if
label
total limit (i.e only 1 line)

is given.

cheers

mavit
New User
New User
Posts: 5
Joined: Mon Nov 08, 2010 3:05 am

Re: [plugin] Traffic Limits

Postby mavit » Sun Dec 19, 2010 9:32 pm

SpmP wrote:I need monthly accounting, how can I avoid resetting the counter, or save the counter to a file (then reload).

If you don't change the label then the counter doesn't get reset, so try something like:

Night:

Code: Select all

December
<upload limit in bytes>
<download limit in bytes>

Day:

Code: Select all

December
-1
-1


SpmP wrote:My ISP counts traffic, up and down summed together... total traffic (ie up+down)

Ah, okay. That's a situation I hadn't considered. I'll need to modify the plugin to make that possible.

mavit
New User
New User
Posts: 5
Joined: Mon Nov 08, 2010 3:05 am

Re: [plugin] Traffic Limits

Postby mavit » Sun May 19, 2013 2:00 pm

SpmP wrote:My ISP counts traffic, up and down summed together... total traffic (ie up+down)


The latest version of the plugin should handle this. Please give it a try and let me know how you get on!


Return to “Plugins”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests