LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2009, 10:24 PM   #1
jestinjoy
Member
 
Registered: May 2004
Location: India
Distribution: Ubuntu 9.04, Debian Lenny
Posts: 121

Rep: Reputation: 22
Wink Scheduling a program to automatically start/stop


Hi,

I am using ubuntu 8.10. I want to automatically start/stop a program(gwget,bittornado gui) at specific time.I tried the program GNOME Schedule.The task is shown cleared at a specific time, but it is not executed. Also I tried adding to cron jobs,but it didnt get executed.Please help.
 
Old 04-16-2009, 12:12 AM   #2
rriggs
Member
 
Registered: Mar 2009
Location: Colorado, US
Distribution: Fedora 13, Fedora 14, RHEL6 Beta
Posts: 46

Rep: Reputation: 17
The problem is that these are GUI apps, and crons and GNOME Schedule are designed to run command-line apps. The program has no way to attach to the display when run from these tools.

If you start the program with a script (by running "gwget &" for example) , you can capture the PID (in the special variable "$!" in bash). You can then set timers with "at" to send "STOP" and "CONT" signals with kill.

Quote:
gwget ... &
pid=$!
# Only download at night when no one is watching...
echo "kill -s STOP $pid" | at 6AM
echo "kill -s CONT $pid" | at 10PM
It may not work cleanly for many reasons...
 
Old 04-16-2009, 04:51 AM   #3
maresmasb
Member
 
Registered: Apr 2009
Posts: 108

Rep: Reputation: 24
gwget is just a wrapper for the commandline tool wget.
There are a lot of commandline torrent tools available to replace your current GUI tool for torrents.

Switching to commandline tools will allow you to use cron jobs and GNOME Schedule jobs. Even more, you write your own shell scripts to do exactly what want to achieve.

Last edited by Tinkster; 10-30-2010 at 04:12 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I automatically start a program at start up? victordh Linux - General 7 10-27-2013 07:02 AM
Automatically Start A Program pafinator11 Linux - Software 5 06-09-2006 04:10 PM
How to set a program to automatically start wfernley Linux - Newbie 8 04-16-2005 02:20 PM
How do I start a program automatically when I boot up? bad_andy Mandriva 2 11-27-2004 09:15 PM
Xwindows starts automatically at start up How can I stop that? Wolfy Linux - Newbie 8 06-29-2004 06:51 AM


All times are GMT -5. The time now is 08:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration