Latest LQ Deal: Linux Power User 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 03-20-2006, 01:55 PM   #1
LQ Newbie
Registered: Mar 2004
Location: Valdosta, GA
Distribution: Suse Pro 10.0
Posts: 10

Rep: Reputation: 0
using cron to start and stop a bash script

I'm trying to use cron to run a shell script at a specific time, then run another script to stop the initial script 3 and a half hours later. The script will start properly, and running the stop script manually stops the process, but it doesn't seem to run through cron and stop the process. here are the relevant files...


OF=spec3130-$(date +%F).rm

#Production line for pushing video to a legacy push server and archiving the file.
/home/apps/producer/producer -pid /tmp/ -vc /dev/video0 -vp 01 -ac /dev/dsp -ap 06 -cs 640x480 -d 3:30:00 -o $TGTD$OF


kill -s 2 $(cat /tmp/
# check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly
-*/15 * * * *   root  test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
*/5   * * * *   cactiuser php /srv/www/htdocs/cacti/poller.php > /dev/null 2>&1
00   17 * * Thu   root /home/apps/
30   20 * * Thu   root /home/apps/
I'm a relative newb at shell scripting. any suggestions?
Old 03-20-2006, 02:06 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
If you have a crond environment where those commands aren't in the path, try using the full path to the command. On my system, would be:

/bin/kill -s 2 $(/usr/bin/cat /tmp/
Old 03-20-2006, 02:30 PM   #3
LQ Newbie
Registered: Mar 2004
Location: Valdosta, GA
Distribution: Suse Pro 10.0
Posts: 10

Original Poster
Rep: Reputation: 0
still a no go. I do a ps ax after the script is supposed to have run and the start script is still up and running along with the producer process it starts...


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 & cron probs. skubik Programming 17 10-16-2005 02:00 PM
cron bash script troubles zzyzx Slackware 3 04-12-2005 12:27 PM
bash script to stop isdn service after x mintus? paul.nel Programming 4 03-11-2004 10:01 AM
bash script from cron kubla Programming 3 01-22-2004 04:30 AM
webmin,cron and bash login script colesen Linux - Software 0 08-12-2003 07:36 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:22 PM.

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