You are not logged in.

#1 2015-06-26 12:28:07

eMan
Member
From: Esfahan
Registered: 2010-08-16
Posts: 52

[SOLVED] Crontab cannot execute rtorrent

Hi there.
As the subject tells, crontab cannot execute rtorrent. I tried various ways but with no result.
First add rtorrent to crontab

00 07 * * * rtorrent

Second use the full path

00 07 * * * /usr/bin/rtorrent

Third use screen with different options. Even with full path.

00 07 * * * screen /usr/bin/rtorrent

But there is noway. Rtorrent does not start at the time I determined.
I am totally frustrated. Is there anything I forget?
I have to mention all these command works correctly in the bash but in cron there is no way. For example screen /usr/bin/rtorrent start rtorrent perfectly but when I use this inside the cron, nothing happens. I even wrote a two line script for this and force cron to execute that script but it does not work.
I Google all this week but cannot find a solution to settle this problem.

Last edited by eMan (2015-06-26 17:40:24)

Offline

#2 2015-06-26 13:00:23

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [SOLVED] Crontab cannot execute rtorrent

cron only works for jobs that return or fork after executing the command. Both rtorrent and screen do not fit this requirement. Try `screen -dm rtorrent` to have screen return automatically as described in the manpage:

-d -m   Start screen in "detached" mode. This creates a new session but doesn't attach to it. This is useful for system startup scripts.

Offline

#3 2015-06-26 17:39:46

eMan
Member
From: Esfahan
Registered: 2010-08-16
Posts: 52

Re: [SOLVED] Crontab cannot execute rtorrent

Thank you so much Spider. With your help now everything is good here.
I start the app by this line in cron

05 02 * * * /usr/bin/screen -dm -s tr rtorrent

And stop it with following line

05 07 * * * /usr/bin/screen -X quit

Offline

Board footer

Powered by FluxBB