LinuxQuestions.org
Visit Jeremy's Blog.
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, 03: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, 06:15 AM   #2
lucmove
Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Jessie
Posts: 795

Rep: Reputation: 76
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, 07:59 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,892
Blog Entries: 27

Rep: Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183
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, 02: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, 02: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


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 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 04:38 PM
How to run shell scripts wrapped in Python. narnie Programming 20 07-15-2010 01:41 AM
how to run python script from c? rabbit2345 Programming 3 01-31-2010 06:42 PM
run a bash script using python. deathalele Programming 3 09-13-2008 09:07 PM
Help to run many scripts from a master script sharp859 Linux - Newbie 4 06-28-2008 12:17 AM

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

All times are GMT -5. The time now is 01: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration