This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to schedule your downloads or ktorrent

Tags: None
(comma "," separated)
torrentand
Registered Member
Posts
1
Karma
0
First let me thank all the devlopers of ktorrent for making a very good client.

This is a simple guide on how to start Ktorrent application at particular time and close the same at particular time(only cmds).
This guide will also show you how to shutdown the system at particular time in an nice way(only cmds).

This guide will also give you the hint on how to start and close connection to your isp .

I will not go into too much of details , because then there is no limit , you can pm me or can ask others.

Tested on: kubuntu , kde 3.5.1 , latest svn ktorrent(devlopment version) and not the 1.2 release version , so i dont know if it will work in 1.2 rel version or not.


We need to enter the commands in crontab file . This can be done either
through console mode(crontab -u yourusername -e) or through GUI kcron

So fire up the kcron and in variables section add the followings :

DISPLAY=0.0
HOME=path to your home dir
PATH=set the path environment here
remark->in console type "echo $PATH" and copy and paste in above.
SHELL=/bin/bash

Now you need to add the tasks in kcron , i am only going to show the cmds which you can later add them to the task.

First we need to start ktorrent , so we find the full path to it , in console type "which ktorrent" and result should be something like this:
/usr/bin/ktorrent
Again in console type the result "/usr/bin/ktorrent" and your ktorrent application starts up.



again in console type :
" dcop --user yourusername ktorrent KTorrent startAll "
the above command , will start all your torrents download and upload
substitute yourusername with your user name :-)



again in console type :
" dcop --user yourusername ktorrent KTorrent stopAll "
the above command , will stop all your download and uploads
substitute yourusername with your user name :-)



again in console type :
" dcop --user yourusername ktorrent MainApplication-Interface quit "
the above command will terminate or make ktorrent application quit or exit.
substitute yourusername with your user name :-)




Now you know how to start the ktorrent application , start downloads ,stop downloads and quit application.

Now how to shurdown the system.

again in console type :
" dcop --user yourusername ksmserver ksmserver logout 0 2 0 "
the above command will shutdown the system properly in kde environment.
substitute yourusername with your user name :-)
This also disconnect you to your ISP if you are using pppoe dialer(in a rude way).




similarly you can use the " pon and poff " commands to dissconnect to your isp.
Don't forget to read the help on using kcron and man pages of crontab.
Also help on using dcop.

here is my image of kcron, this will help you to enter the cmds.
my appl starts 1.50 , my isp connection starts on 2.10(not shown here) and downloads starts at 2.15 , and stops at 7.00 . and disconnects to isp at 7.05(not shown here) and quits the application at 7.15 and shutdown the system at 7.20.
cheers all.


Image[/list]
imported4-Ivan
Registered Member
Posts
819
Karma
0

Tue Apr 04, 2006 9:02 pm
Wow, great!!!
Thanks a lot for this howto, will make it sticky right now.

I'm planning to implement a built-in scheduler but this will be just fine until I do so.
Turtoise72
Registered Member
Posts
7
Karma
0

Background

Thu Jun 15, 2006 1:32 pm
Does this also work on a multiuser-machine? In example, I have a family PC and want ktorrent to run (as user X) whenever the PC is running, regardless on who actually is logged in (might be user X, could be user Y). Ideally, user Y should not be bothered by ktorrent, while user X, if logged on, should see the ktorrent icon in his system tray.

I dont think that just starting a new session with leaving X being logged in is a solution here, as the machine is randomly rebooted to windows by user Z, but ktorrent should automatically resume its work once user X or Y reboots to Linux...
George
Moderator
Posts
5421
Karma
1

Thu Jun 15, 2006 6:49 pm
If KT gets started up as user X, user Y will not notice this and it will not be in his system tray.
Turtoise72
Registered Member
Posts
7
Karma
0

Starting Ktorrent at boot...?

Wed Jun 21, 2006 10:12 pm
The solution showed in the first post using CRON only works if the machine is on all the time, right?

I want to start ktorrent after every boot, so I created a script:

sudo -b -u turtoise /opt/kde3/bin/ktorrent

and set it to be executed at runlevel 5. However, this does not work. Why? How can I make sure that Ktorrent runs regardless of who logs into my machine after a boot?

Using CRON to start ktorrent every hour is probably a bad idea too, right? Since Ktorrent allows several instances of itself running at once. Is this a problem, i.e. will two instances of Ktorrent mess up its files or does Ktorrent tolerate running more than once as the same user with the same configuration (hence downloading the same torrents)?
George
Moderator
Posts
5421
Karma
1

Re: Starting Ktorrent at boot...?

Thu Jun 22, 2006 6:01 pm
Turtoise72 wrote:The solution showed in the first post using CRON only works if the machine is on all the time, right?

I want to start ktorrent after every boot, so I created a script:

sudo -b -u turtoise /opt/kde3/bin/ktorrent

and set it to be executed at runlevel 5. However, this does not work. Why? How can I make sure that Ktorrent runs regardless of who logs into my machine after a boot?


You need an X server running first of all, otherwise it is not gonna startup. If you login, you can just let KDE's session management do it, but without a login, it can be more problematic. KT is not a daemon running in the background, and what you are trying to do is using KT as a daemon.

Using CRON to start ktorrent every hour is probably a bad idea too, right? Since Ktorrent allows several instances of itself running at once. Is this a problem, i.e. will two instances of Ktorrent mess up its files or does Ktorrent tolerate running more than once as the same user with the same configuration (hence downloading the same torrents)?


That would fail, a user can only start one instance of KT, multiple users need to make sure they use different ports.
hcostelha
Registered Member
Posts
14
Karma
0

Thu Dec 14, 2006 3:45 pm
With the Bandwith Scheduler on ktorrent now, this howto is not needed anymore, right?

The Bandwidth scheduler works very well and it is very easy to use. You just need to open KTorrent go to Settings->Configure ktorrent->Plugins, select the "schedulerplugin" and press Load. Now you have an aditional item on the left side bar of the setting configuration dialog, and you have also an icon on the toolbar of the ktorrent main window. Just click it to configure the Bandwidth scheduler.
mjc2928
Registered Member
Posts
1
Karma
0

Thu Feb 08, 2007 10:02 pm
In relation to hcostelha's post, was the bandwidth scheduler removed in the most recent version (2.1)? It was a plugin in the previous version, can we find it somewhere?
hcostelha
Registered Member
Posts
14
Karma
0

Thu Feb 08, 2007 10:31 pm
mjc2928 wrote:In relation to hcostelha's post, was the bandwidth scheduler removed in the most recent version (2.1)? It was a plugin in the previous version, can we find it somewhere?


I have ktorrent 2.1 packed by Guru for openSUSE 10.2, and the bandwidth is there and working fine. It is a plugin as in previous version.
Whitey Ford
Registered Member
Posts
2
Karma
0

Tue Jul 10, 2007 9:39 pm
Sorry to bump an older topic, but I need some help.

I want to be able to set the Scheduler to only download during midnight and 8am, but upload all the time. The problem I am having at the moment is I can only set the minimum download speed to be 1 which means Ktorrent downloads at 1KB/s all day and then unlimited between midnight and 8am.

If I set the download to be 0 then Ktorrent sets the download speed to be unlimited. I don't want to set Ktorrent as 'off' because I want to be able to upload all day.

Is there a way to set the download to 0KB/s and the upload to unlimited?
George
Moderator
Posts
5421
Karma
1

Wed Jul 11, 2007 8:51 am
Currently that is not possible
Whitey Ford
Registered Member
Posts
2
Karma
0

Thu Jul 12, 2007 9:36 am
No dramas, 1KB/s isn't going to make much of a dent, thanks for the reply.
bowser03
Registered Member
Posts
5
Karma
0

which ktorrent blank reply

Thu Aug 30, 2007 10:20 am
I don't really know if I have actually installed KTorrent, since I typed "which ktorrent" and it gave a blank liine empty as ever in return. Please help.
bowser03
Registered Member
Posts
5
Karma
0

Thu Aug 30, 2007 11:17 am
Update: I am currently running Knoppix 5.2. I have Python installed. There seems to me something going on in "make" and 'make install" and there are some "no"s that happen in the end. Still I have no knowledge of any real installation of a ktorrent file on the system.
bowser03
Registered Member
Posts
5
Karma
0
that make didn't install the ktorrent in the /usr/local/bin directory?


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft