å¤éèµ·åãé²ãã·ã§ã«ã¹ã¯ãªãã
cronçã§ã·ã§ã«ãè¤æ°åå®è¡ããæãå¤éèµ·åããã¨ã¾ããã®ã§ããããåé¿ããã¹ã¯ãªããã
æ¥åä¸å¿
è¦ã ã£ãã®ã§ä½ã£ã¦ã¿ãã
#!/bin/sh SCRIPT_PID="/home/takase/work/run_script.pid" if [ -f $SCRIPT_PID ]; then PID=`cat $SCRIPT_PID ` if (ps -e | awk '{print $1}' | grep $PID >/dev/null); then exit fi fi echo $$ > $SCRIPT_PID (ãã®è¾ºã«ãããã®å¦ç) rm $SCRIPT_PID
pidã§ããã»ã¹ã®æç¡ã確èªãã¦ããã®ã§èµ·åä¸ã¯ï¼éã«å®è¡ãããªããã
ä½ãçç±ããã£ã¦è½ã¡ã¦ãå ´åã¯åå®è¡ãããã
å¾ã¯crontabã«ãã®ã·ã§ã«ãè¨å®ãã¦ããã°OK