Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 05-23-2002, 07:49 AM   #1
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?

Old 05-23-2002, 08:06 AM   #2
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
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

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


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

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 ]

auto reload when it dies....


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 7 12-19-2015 01:03 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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:36 AM.

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