LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-02-2012, 02:59 AM   #1
mandar.nandale
LQ Newbie
 
Registered: Apr 2012
Location: Banglore(India)
Posts: 4

Rep: Reputation: Disabled
Script to run all the python scripts from particular directory


I've a directory called /home/mandar/scripts/daily in which i have 25 python scripts which has to be run at startup.
For this i want to write one shell script. This script should start all the python scripts on boot up and after than every minute monitor if all are running. If any python scripts crashes or is hung your script should restart it.
can anybody help me with this script..
THANK YOU
 
Old 05-03-2012, 05:15 AM   #2
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Rep: Reputation: 110Reputation: 110
I definitely recommend daemontools for that. It's part of a full qmail installation. Look for one of the several qmail installation recipes available everywhere (Qmail Rocks is a good one) and follow the instructions, just as much as daemontools is involved. Or rather just follow the instructions on its home page, it should be easier.

Daemontools is the component that makes sure qmail is always running. I use it for qmail and a couple other unrelated services. You don't need to install qmail for what you want, just daemontools.
 
1 members found this post helpful.
Old 05-03-2012, 06:59 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator response

Moved: This thread is more suitable in <Linux-General> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 05-08-2012, 01:18 AM   #4
mandar.nandale
LQ Newbie
 
Registered: Apr 2012
Location: Banglore(India)
Posts: 4

Original Poster
Rep: Reputation: Disabled
Unhappy

Thanx lucmove i know daemontools is helpful but i want to do this with shell script which letter i will run every minute using crontab. I know how to use crond but i am unable to write a shell script to do above job for me..
 
Old 05-08-2012, 01:29 AM   #5
mandar.nandale
LQ Newbie
 
Registered: Apr 2012
Location: Banglore(India)
Posts: 4

Original Poster
Rep: Reputation: Disabled
Red face

to be more specific i am receiving these python scripts from REST based web server in XML format on my Beagle Bone which i am converting in python(.py) and saving them in /home/mandar/scripts/daily so i am done upto this now i want to write one script to run all python scripts from this directory and monitor them every minute(probably i will use crontab) and if any python process is dead or hung i want to restart it.....HELP ME i am stuck here from last one week...THANK YOU
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to use python scripts to run a dzen2 status bar? daweefolk Linux - General 0 02-08-2011 03:38 PM
How to run shell scripts wrapped in Python. narnie Programming 20 07-15-2010 12:41 AM
how to run python script from c? rabbit2345 Programming 3 01-31-2010 05:42 PM
run a bash script using python. deathalele Programming 3 09-13-2008 08:07 PM
Help to run many scripts from a master script sharp859 Linux - Newbie 4 06-27-2008 11:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:50 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
Open Source Consulting | Domain Registration