LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-23-2002, 07:49 AM   #1
bfloeagle
Member
 
Registered: Jun 2000
Location: Upstate New York
Distribution: Ubuntu
Posts: 158

Rep: Reputation: 30
Question "Check if running" Script...


I'm using a webcam program (the one included with xawtv) that is obviously hosting my webcam to the internet. The only problem is that after about 3 hours, the program terminates... I'm not sure why...

I'm looking for a script that would run every hour or so that looks to see if the webcam program is up and running; if it is not, the script would start it. Anyone know of one?

Andy
 
Old 05-23-2002, 08:06 AM   #2
hanzerik
Member
 
Registered: Jan 2002
Location: Cheyenne Wyoming
Distribution: Debian/Raspbian/Mint
Posts: 717

Rep: Reputation: 32
setup a cron job:

0 * * * * /usr/bin/xawtv-program-name -nice 19 > /dev/null 2> /dev/null

This cron job will attempt to start the program at the top of every hour.
If it is already running, the next invocation will do nothing.
If the program is not running, it will be started.
For more information on cron jobs see the crontab(1) manual page.

Last edited by hanzerik; 05-23-2002 at 08:07 AM.
 
Old 05-23-2002, 08:12 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,395

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
you wouldn't find an existing script to do that... cos it's just so damn easy and simple to write yourself!

e.g.

if [ `ps ax | grep webcam | wc -l` -le 0 ]
then
webcam &
fi

set that up as a cron job and it'll be fine. OR... i' suggest a better way to run the whole thing:

while [ 1 = 1 ]
do
webcam
done

auto reload when it dies....
 
  


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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 6 03-21-2013 10:35 AM
KDE - please check that the "DCOPserver" program is running Thanotos Linux - Newbie 2 11-27-2006 06:11 PM
please check that the "dcopserver" program is running Thanotos Slackware 7 11-14-2005 08:06 PM
Warning on running "make check", 2nd time satimis Linux From Scratch 8 07-11-2005 03:46 AM
Warning on running "make check" satimis Linux From Scratch 1 07-09-2005 09:21 PM


All times are GMT -5. The time now is 01:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration