Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
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 !
Offline
Basically, what you'd want to do is execute:
/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/)
* * * * * 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:
/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:
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:
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:
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)
Offline
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.
Offline
Great explanation of cronjobs
Offline
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 :
echo "0 20 * * 1-5 /ffp/bin/killall -SIGINT transmission-daemon" >> /tmp/transmission_work_nights.txt
Should'nt be like this ?
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 !
Offline
Yes, you're right. Bad cut-and-paste. Sorry about that.
Forgot to add that the first line in the script should be:
#!/bin/sh
http://en.wikipedia.org/wiki/Shebang_%28Unix%29
Last edited by scaramanga (2011-05-01 02:24:52)
Offline