aMule Forum
English => en_Linux => Topic started by: Nuke on April 22, 2004, 09:07:18 PM
-
Hi... Since I'm conditioned by my ISP to national traffic, I need to use IP filter but, between 4 and 7 am, I have no limits so, I'd like to be able to remove the IP filter. Someone once told me about a program called cron. Can I do something like shutdown amule at 4am, move the ip filter file to another folder and run amule again. At 7am, shutdown, move back IP filter and run amule?
-
yup
that is true ;)
try man cron
to find out more ;)
just make shure that you export your display when you restart amule in cron, otherwise it won't work
stefanero
-
Originally posted by stefanero
just make shure that you export your display when you restart amule in cron, otherwise it
I'm interested in what you mean, cause my aMule-2.0.0rc3 closes itself very often, without any particular reason.
I had the idea to put it in the crontab to make it launch every hour.
So i did while logged as user :
crontab -e
And added the following line :
0 * * * * /usr/bin/amule
And indeed, in the syslog i see cron launching every hour /usr/bin/amule, but it seems it doesn't really launch it.. No amule running.
What's the problem?
-
http://www.amule.org/amule/thread.php?threadid=1232&sid=
http://www.amule.org/amule/thread.php?threadid=542
http://deepthought.ena.si/mulerunner
-
hey
since cron is a system job it can't access your display where KDE is running for example.
so oyu have to disable access control for your display
$xhost +
will disable any control (so maybe not the best idear ;) )
and in your cron job you have to add
$export "DISPLAY=localhost:0"
and I think thats it ;)
I am not 100% sure but should work
stefanero
-
OK Stefanero, gonna try that.
Btw... the "test" shell command doesn't function, not returning anything. Do i miss something?
-
Nice! It works, i just added "env DISPLAY=:0.0" before my cron command.
I didn't have to do the $xhost+ command.
Now i have this line in my crontab :
0 * * * * env DISPLAY=:0.0 /usr/bin/amule > /home/julien/cronlogs/clear_temp_dir.txt >/dev/null 2>&1
aMule starts every hour now. Don't know what happens if it's already running thou :-?
-
if it's already runnin, it won't be started again.
aMule checks at startup if that user is already running som eother instance of aMule. If he/she is running it, then it closes itself and lets the other continue running.
Anyway, I think the scripts DeltaHF told you suit better your needs ;-)
Greetings.
-
yup maybe, but as mentionned above, the "test" command doesn't work on my comp (MDK10). Anyway, i set the cron command for every 30 minutes, t's ok
-
well, this will surely work on bash then:
while true; do amule; done
;-)
It avoid aMule to be starded every x minutes, instead, it will be restarted when it crashes. But you'll have to kill the bash shell, not only aMule, whenever you want to cleanly close aMule.
Greetings!