Overclockers Australia Forums
OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Other Operating Systems

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 10th April 2011, 8:53 AM   #211
von Stalhein
Member
 
von Stalhein's Avatar
 
Join Date: May 2002
Location: Thurgoona NSW
Posts: 1,664
Default Cron query

What haven't I covered here?
I can't get this to go.
As you can see, I want it to start at everyday 1:58 am and terminate at 8:01am.
The "killall" is probably a bit agricultural as well I suppose.


Code:
# m h  dom mon dow   command
   58 1 * * * /usr/bin/deluge-gtk
   1 8 * * * killall deluge-gtk
__________________
80386 sx25 o/c @ 26.133 Mhz | 40 Meg HDD | Cirrus Logic SVGA | 2 Meg RAM | DOS 3.1 --> Ninja!!!!
von Stalhein is offline   Reply With Quote

Join OCAU to remove this ad!
Old 10th April 2011, 8:55 AM   #212
shift
Member
 
shift's Avatar
 
Join Date: Jul 2001
Location: Hillcrest, Logan
Posts: 2,878
Default

Quote:
Originally Posted by von Stalhein View Post
What haven't I covered here?
I can't get this to go.
As you can see, I want it to start at everyday 1:58 am and terminate at 8:01am.
The "killall" is probably a bit agricultural as well I suppose.


Code:
# m h  dom mon dow   command
   58 1 * * * /usr/bin/deluge-gtk
   1 8 * * * killall deluge-gtk
If that's a gtk based app, you'd need to give it a display to use.
__________________
"The best thing about the internet is you can make up anything." - Ghandi
"Mit der Dummheit kämpfen Götter selbst vergebens" (Against stupidity the gods themselves struggle in vain.) - Friedrich Schiller
shift is offline   Reply With Quote
Old 10th April 2011, 9:47 PM   #213
HyRax1 Thread Starter
48656C6C6F20576F726C6421
 
HyRax1's Avatar
 
Join Date: Jun 2001
Location: At a desk. Distro:Ubuntu
Posts: 7,078
Default

Yeah, you need to add something like "--display :0" to the first line there, assuming that it supports specifying a display value like that.

Why do you want to launch and close the GTK interface on a schedule anyway?
__________________
If practice makes perfect, and nobody's perfect, why practice?
HyRax1 is offline   Reply With Quote
Old 10th April 2011, 10:40 PM   #214
elvis
Member
 
elvis's Avatar
 
Join Date: Jun 2001
Location: Brisbane
Posts: 19,937
Default

I constantly see people try to start deluge in the GUI via cron, and likewise try to kill their torrent stuff via cron.

Deluge allows a daemon ("service") to run in the background. It can be controlled by a variety of systems, including GUI, web and command line.

On my file server, deluge-daemon autostarts at boot (standard boot scripts), and runs as user "tv" (don't ask). Deluge-web is installed to manage it from any machine in the house (or remote via VPN). Deluge-console can be used to fire commands at the running deluge-daemon, and do things like speed up or slow down running torrents. Deluge has also been set up to only seed to 200%, and then pause the running torrent (config variable "share_ratio_limit").

In /etc/rc.local (runs on boot after all other runlevels)
Code:
# Set torrents to be in "slow" mode on startup
# Daily schedule will speed these up when needed
su - tv -c "/home/tv/scripts/deluge_slow"
In /etc/crontab:
Code:
## 2:00 am offpeak - torrent
10 2	* * *	tv	/home/tv/scripts/deluge_fast

## 8:00 am midday onpeak - torrent
50 7   * * *   tv	/home/tv/scripts/deluge_slow
Scripts:

/home/tv/scripts/deluge_slow - Slows torrents down to 1kbit/s down, 1kbit/s up. Theoretically you could do fractions to slow it further.
Code:
#!/bin/bash
LOG=/home/tv/log/deluge_speed.log
date >> $LOG
deluge-console "config --set max_download_speed 1.0" >> $LOG
deluge-console "config --set max_upload_speed 1.0" >> $LOG
/home/tv/scripts/deluge_fast - speed it up to full speed download, 50kbit/s upload cap (because my ADSL2 connection is shit, and 50kbit/s is the sweet spot before I flood my own ACKs and reduce the download speed):
Code:
#!/bin/bash
LOG=/home/tv/log/deluge_speed.log
date >> $LOG
deluge-console "config --set max_download_speed -1" >> $LOG
deluge-console "config --set max_upload_speed 50.0" >> $LOG
You could do anything you like. If the speed up / slow down thing doesn't tickle you, then just do a start all / pause all instead.
__________________
Child's Play Charity
elvis is offline   Reply With Quote
Old 10th April 2011, 10:59 PM   #215
HyRax1 Thread Starter
48656C6C6F20576F726C6421
 
HyRax1's Avatar
 
Join Date: Jun 2001
Location: At a desk. Distro:Ubuntu
Posts: 7,078
Default

In addition to the above, you can also modify the number of download slots via cron, which will allow you to cease or reduce downloading at peak times if required, but allow seeding uploads to continue (assuming your uploads don't contribute to your quota of course).

Code:
# Enable 5 active download slots at midnight and then set it to zero slots at midday.
0 0 * * * /usr/bin/deluge-console "config --set max_active_downloading 5"
0 12  * * * /usr/bin/deluge-console "config --set max_active_downloading 0"
__________________
If practice makes perfect, and nobody's perfect, why practice?
HyRax1 is offline   Reply With Quote
Old 10th April 2011, 11:58 PM   #216
von Stalhein
Member
 
von Stalhein's Avatar
 
Join Date: May 2002
Location: Thurgoona NSW
Posts: 1,664
Default

Thanks guys - yes, I think I have had it going as just the daemon at some time in the past, but I deleted/changed the cron file ages ago. I remember the Deluge install being different to this one now anyway.
As the (GUI) program was started by "deluge-gtk" I thought that was the command I should use in the file.

I'll go to school on all the suggestions above.
__________________
80386 sx25 o/c @ 26.133 Mhz | 40 Meg HDD | Cirrus Logic SVGA | 2 Meg RAM | DOS 3.1 --> Ninja!!!!
von Stalhein is offline   Reply With Quote
Old 15th June 2011, 7:07 PM   #217
von Stalhein
Member
 
von Stalhein's Avatar
 
Join Date: May 2002
Location: Thurgoona NSW
Posts: 1,664
Default

Right, got the Deluge thing sorted thanka - a while back obviously!!!

Now, another issue I've been having for a while, and the tolerance level has just reached critical mass.

Refreshing software sources gives the following error:
Code:
Failed to fetch http://ppa.launchpad.net/indicator-multiload/stable-daily/ubuntu/dists/maverick/main/source/Sources.gz  404  Not Found
Failed to fetch http://ppa.launchpad.net/indicator-multiload/stable-daily/ubuntu/dists/maverick/main/binary-i386/Packages.gz  404  Not Found
What's the best way to fix that - just delete the entries? Am I missing update packages I should be getting?
I've chased the locations down in a browser, and it's not lying :-)

Would there be a substitute location that hasn't automagically updated?
__________________
80386 sx25 o/c @ 26.133 Mhz | 40 Meg HDD | Cirrus Logic SVGA | 2 Meg RAM | DOS 3.1 --> Ninja!!!!
von Stalhein is offline   Reply With Quote
Old 15th June 2011, 8:23 PM   #218
HyRax1 Thread Starter
48656C6C6F20576F726C6421
 
HyRax1's Avatar
 
Join Date: Jun 2001
Location: At a desk. Distro:Ubuntu
Posts: 7,078
Default

Quote:
Originally Posted by von Stalhein View Post
What's the best way to fix that - just delete the entries? Am I missing update packages I should be getting?
I've chased the locations down in a browser, and it's not lying :-)

Would there be a substitute location that hasn't automagically updated?
Having a look at that PPA, it only has packages for Natty and Oneiric - nothing for Maverick and below.

While you can generally get away with using older repos with a given version of Ubuntu, you can't always get away with using newer. Doesn't hurt to try, however - I would simply expect dependencies to be unsatisfiable in a fail scenario.

Otherwise if you don't need the packages supplied by this PPA, then simply delete/comment those lines from your list, or delete the list files they are referenced in if they are separate.
__________________
If practice makes perfect, and nobody's perfect, why practice?
HyRax1 is offline   Reply With Quote
Old 15th June 2011, 8:35 PM   #219
von Stalhein
Member
 
von Stalhein's Avatar
 
Join Date: May 2002
Location: Thurgoona NSW
Posts: 1,664
Default

OK thanks, I'll probably comment them out. Yes I'd seen the later versions and didn't want to take the jump without checking.

I'm playing with Natty in a VM, but I think I'll wait to fully upgrade until the next LTS, so the minor inconsistencies simliar to this one will be about I suppose.
__________________
80386 sx25 o/c @ 26.133 Mhz | 40 Meg HDD | Cirrus Logic SVGA | 2 Meg RAM | DOS 3.1 --> Ninja!!!!
von Stalhein is offline   Reply With Quote
Reply

Bookmarks

Tags
linux, ubuntu

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 9:35 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!