#!/usr/bin/perl # if your prgram has the string "grep" in the name or in the path # this program won't work. open PROS, "ps -ax|grep your_program|"; while ($line = ){ unless ($line =~ m/grep/){ #print "it is running\n"; exit; } } #print "it isn't running\n"; exec 'nohup /home/you/your_program &';