DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-04-28 19:14:03

sil51
Member
From: France
Registered: 2009-04-25
Posts: 19
Website

How to schedule Transmission

Hi all,

I'm noob in Unix usages.. but I learn through this forum, thanks to all !

This time, I have to schedule Transmission process.
I would like to start the daemon every week days at 08:00 pm and stop it every week days at 08:00 am.
And keep the process running all long every week-ends.

I've seen something like cron or crontab, but I don't understand how to configure it.

Someone could help me ?

DNS-323 H/W rev B1 / fun_plug 0.5 / transmission 2.22


Thanks to all !


-=[ Sil 51 ]=-
DNS-323 / Firmware 1.09 / 2 x SAMSUNG Spinpoint F1 1To HD103UJ / FFP 0.5

Offline

 

#2 2011-04-28 20:18:41

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: How to schedule Transmission

Basically, what you'd want to do is execute:

Code:

/ffp/bin/su nobody -c /ffp/bin/transmission-daemon -f -g /mnt/HD_a2/.transmission-daemon > /mnt/HD_a2/.transmission-daemon/transmission-daemon.log 2>&1 &

(that's the default start action for transmission in kylek's ffp package)

On Mon, Tue, Wed, Thu and Fri at 8p.m., which in cron's scheduling language translates to "0 20 * * 1-5" (Read more about it here: http://crontab.org/)

Code:

*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)

Also, you'd like to execute:

Code:

/ffp/bin/killall -SIGINT transmission-daemon

(that's the default stop action for transmission in kylek's ffp package)

On Mon, Tue, Wed and Thu Fri at 8am, which in cron's scheduling language translates to "0 8 * * 1-5"

What you want to do is write a script that runs each startup (place it in /ffp/start, make sure it has executable permissions, and does the following:

Code:

crontab -l > /tmp/transmission_work_nights.txt
echo "0 20 * * 1-5 /ffp/bin/su nobody -c /ffp/bin/transmission-daemon -f -g /mnt/HD_a2/.transmission-daemon > /mnt/HD_a2/.transmission-daemon/transmission-daemon.log 2>&1 &" >> /tmp/transmission_work_nights.txt
echo "0 8 * * 1-5 /ffp/bin/killall -SIGINT transmission-daemon" >> /tmp/transmission_work_nights.txt
crontab /tmp/transmission_work_nights.txt
rm /tmp/transmission_work_nights.txt

Also, change the permissions of /ffp/start/transmission.sh so that it doesn't have execute permissions:

Code:

chmod a-x /ffp/start/transmission.sh

No you'll either need to reboot or run the script manually. To see that everything looks good, list all scheduled cron jobs:

Code:

crontab -l

Note: Obviously, I haven't tried it myself, so it might might not work out of the box, but it's pretty straightforward

Edit: Fixed wrong schedule for killall

Last edited by scaramanga (2011-05-01 02:26:38)


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#3 2011-04-28 20:26:18

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: How to schedule Transmission

You could run Transmission 24/7 and use the built in schedule to set the U/L and D/L limits to zero during certain time periods.


3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

#4 2011-04-28 21:40:08

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: How to schedule Transmission

Great explanation of cronjobs smile


DNS-313

Offline

 

#5 2011-05-01 01:10:18

sil51
Member
From: France
Registered: 2009-04-25
Posts: 19
Website

Re: How to schedule Transmission

Hi all,

Thanks for your replies!

scaramanga : Well you seem to drive crontab.

I'm learning about crontab, and more generally unix commands.
I can't test the script for now, until I go to work on monday.

But I'm thinking about your script, this line :

Code:

echo "0 20 * * 1-5 /ffp/bin/killall -SIGINT transmission-daemon" >> /tmp/transmission_work_nights.txt

Should'nt be like this ?

Code:

echo "0 8 * * 1-5 /ffp/bin/killall -SIGINT transmission-daemon" >> /tmp/transmission_work_nights.txt

So could you confirm if I have to write 8 or 20 ? As i want to stop the daemon at 8:00 am.
I'm new but I want to learn !

Finally, this script would replace the orginal transmission.sh ?

FunFiler : I thought this way, but I'm not sure if this feature stop all p2p connexions with speed at 0. Do you believe 0 kb will stop the transmission net usage to assume that net connexion is as if transmission deamon is stopped ?


I like this forum and its members, thanks to all !


-=[ Sil 51 ]=-
DNS-323 / Firmware 1.09 / 2 x SAMSUNG Spinpoint F1 1To HD103UJ / FFP 0.5

Offline

 

#6 2011-05-01 02:19:29

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: How to schedule Transmission

Yes, you're right. Bad cut-and-paste. Sorry about that.
Forgot to add that the first line in the script should be:

Code:

#!/bin/sh

http://en.wikipedia.org/wiki/Shebang_%28Unix%29

Last edited by scaramanga (2011-05-01 02:24:52)


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB