How to keep a job running in Linux Rumi, November 13, 2017November 13, 2017 There are many ways to keep a process running on linux but I haven’t seen any that are as easy to implement as the script below. Basically the script does a ps ax and then a grep for your process. If it’s not running it will re-start the process. You install the script into your crontab i.e. crontab -e As a bonus this mechanism will re-start your process after a re-boot. Edit your crontab Cut and paste the following code into your crontab. */5 * * * * /home/path_to_the_script/make-run.sh Make sure the cron entry is pointing to where your make-run.sh is located. The Bash script #!/bin/bash # make-run.sh # make sure a process is always running. # Add the following to the crontab (i.e. crontab -e) # */5 * * * * /home/path_to_make_run/make-run.sh process=servermonitoringhq makerun="/home/path_to_the_job_you_want_running/runjob.sh" if ps ax | grep -v grep | grep $process > /dev/null then exit else $makerun & fi Test the script on it’s own first to make sure it starts your job. Related Scripts BashCronShell
Vertical CSS menu August 16, 2009 In this tutorial you will learn the basics of creating simple vertical menus for your website using only HTML /and CSS. Our menus are actually HTML unordered list elements <ul> styled using CSS, giving them background color, margin, padding and other CSS attributives. Related Read More
Using the DIV tag to display columns rather than tables November 15, 2013 The TABLE element may be a convenient way of producing stable layouts, but the W3C WAI guidelines are pretty clear that tables are for displaying tabular information, not for arranging page content. The DIV element is used as the basic layout element as it does not add any extra meaning… Read More
Zimbra Domain Administration (Multi-tenant) June 4, 2015 In order to create a multi tenancy in zimbra OSA, can be acheived through a bash script below. Thanks to Ahmad Imanuddin (http://www.imanudin.com) for sharing this very useful script. cd /srv/ vi admin-delegate.sh Fill with the following line : Related Read More