LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   run script as service (https://www.linuxquestions.org/questions/linux-server-73/run-script-as-service-4175415866/)

deepak_message 07-10-2012 05:10 AM

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.

acid_kewpie 07-10-2012 05:20 AM

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.


All times are GMT -5. The time now is 06:52 PM.