LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-10-2012, 05:10 AM   #1
deepak_message
Member
 
Registered: Oct 2007
Posts: 157

Rep: Reputation: 16
run script as service


I have linux machine, where printer is configured. some time it goes down automatic.

I need to make script, which should work like service.

I have prepared script, which checks by cron every 30 minute.

but I am looking service, which send me mail, when printer goes down. and enable itself.
 
Old 07-10-2012, 05:20 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
I would recommend leaving it as a cron job. The only difference would be that you'd be putting some form of infinite loop in the script itself, which has no benefit other than higher time resolution, i.e. you can run it more than once a minute. If it crashes or hangs though, you won't know and it won't do anything. If it's a cron job it starts every minute, 30 minutes etc, so the logic is much easier and more reliable.

there is nothing magical about a "service"... it's just whatever you want it to be.
 
  


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
[SOLVED] write a shell script so that it can run as service/daemon deostroll Programming 10 03-08-2010 10:03 AM
How to run perl script as service tdnnash25 Linux - Server 6 12-24-2009 01:35 AM
How do I run a script as a service NickJH Linux - Newbie 5 09-14-2009 01:56 PM
need a script to run oracle service shipon_97 Linux - Enterprise 5 03-02-2007 07:43 AM
How do I run a PHP script as a service? robbiemorgan Linux - Newbie 3 04-13-2005 02:03 PM


All times are GMT -5. The time now is 09:57 AM.

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