linux - Does a Cron job overwrite itself -


i can't seem script run in parallel every minute via cron on ubuntu 14.

i have created cron job executes every minute. cron job executes script runs longer minute. when minute expires seems new cron execution overwrites previous execution. correct? ideas welcomed.

i need concurrent independent running jobs. cron job runs script queries mysql database. idea poll db- if yes execute script in own process.

you need locking mechanism identify script running.

there several ways of doing need careful use atomic method.

i use lock directories creating directory guaranteed atomic -

lockdir=/tmp/myproc.lock  if ! mkdir $lockdir >/dev/null 2>&1   print -u2 "processing running - terminating"   exit 1 fi  trap "rm -rf $lockdir" exit 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -