Skip to content

7. Scheduling

Mehran Ahadi edited this page Oct 25, 2016 · 4 revisions

It's possible to schedule tasks using cronjobs and the python scripts. At this time, there are four scripts available to use.

Assuming you installed LoadBox on /home/[username]/LoadBox directory:

Limit Download Speed

Limits transfer speed to a maximum level defined as conf_cron_maxspeed() and conf_cron_maxupspeed() options in scripts/configuration.pyfile.

/home/[username]/LoadBox/scripts/limitdownloads.py

Remove Download Speed Limit

Removes the speed limit.

/home/[username]/LoadBox/scripts/unlimitdownloads.py

Start All Download Tasks

/home/[username]/LoadBox/scripts/startdownloads.py

Stop All Download Tasks

/home/[username]/LoadBox/scripts/stopdownloads.py

To schedule actions, enter sudo crontab -e to open cron jobs editor. Enter schedulings in this format:

[min] [hour] [day of month] [month] [day of week] [script path]

As an example:

30 02 * * * /home/[username]/LoadBox/scripts/unlimitdownloads.py
00 10 * * * /home/[username]/LoadBox/scripts/limitdownloads.py

It will limit download speed everyday at 10:00AM and removes limitation after midnight on 02:30AM.

Schedule downloads for late night

You might want to schedule downloads to run on late night hours to use free or low priced nightly internet traffic. Assuming from 2:00 AM to 6:00 AM, you can define cron jobs like this:

* 6-23,0-1 * * * /home/pi/LoadBox/scripts/stopdownloads.py
* 2-5 * * * /home/pi/LoadBox/scripts/startdownloads.py

* 6-23,0-1 * * * /home/pi/LoadBox/scripts/limitdownloads.py
* 2-5 * * * /home/pi/LoadBox/scripts/unlimitdownloads.py

It will try to stop downloads during daytime and run them on the night. Although it sends a stop signal every minute, the user might accidentally start a download during daytime and continue using the traffic up to 60 seconds until the next stop signal get sent. As a workaround, it would limit download speed in daytime to minimize the traffic used. Remember to set conf_cron_maxspeed directive to a limited amount in configuration.py file. In addition, it might be a good idea to set pause directive in configuration.conf file to true to set the default state of the newly added downloads to Paused until they get started by the respective cron job at the night.

You can’t perform that action at this time.