2015-01-13 3 views
0

안녕하세요, crontab이 제 시간에 실행할 수없는 이유를 알고 계신 분 있습니다. 그것은 적어도 10 초 지연되었습니다. 그것은 aws EC2 인스턴스입니다.시간에 crontab을 실행할 수없는 이유

shell>uname -a  
shell>Linux srv-796-db1 3.14.20-20.44.amzn1.x86_64 #1 SMP Mon Oct 6 22:52:46 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux #Server Info 


awk '{split($3,a,":"); if (a[3] > 10) {print;}}' /var/log/cron | head -50 
Jan 11 22:30:13 srv-796-db1 CROND[12017]: (root) CMD (sleep 20; /usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12019]: (root) CMD (sleep 10; /usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12021]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12024]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12026]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12030]: (root) CMD (sleep 40; /usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12032]: (root) CMD (sleep 30; /usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12034]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12037]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12041]: (root) CMD (sleep 20; /usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:13 srv-796-db1 CROND[12045]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:14 srv-796-db1 CROND[12048]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:30:14 srv-796-db1 CROND[12052]: (root) CMD (/usr/lib64/sa/sa1 1 1) 
Jan 11 22:40:11 srv-796-db1 CROND[18845]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:40:11 srv-796-db1 CROND[18848]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:40:11 srv-796-db1 CROND[18849]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:40:11 srv-796-db1 CROND[18854]: (root) CMD (/usr/lib64/sa/sa1 1 1) 
Jan 11 22:40:11 srv-796-db1 CROND[18855]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 
Jan 11 22:40:11 srv-796-db1 CROND[18858]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1) 

어떤 아이디어 ???

+1

cron이 작업을 실행하도록 보장합니까? 정확히 00 초에? – zerkms

+0

아니요, cron은 해당 작업이 00 초에 정확하게 실행될 것이라고 보장하지 않았습니다. 그러나 다른 서버에서는 일반적으로 모든 서버를 실행하는 데 1 초가 걸립니다. aws에서는 역동적입니다. 근본 원인이 무엇인지, 왜인지 모릅니다. –

+0

그래서 그들은 cron의 동일한 구현입니까? 그리고 같은 버전? – zerkms

답변

0

그냥이 질문을 닫으려면 .. Cronjob은 일정에 따라 작업이 정확하게 실행된다는 것을 보장하지 않습니다. 그러나 작업을 시작하기 전에 마지막 작업 상태를 확인합니다. 마지막 작업이 완료되지 않은 경우 프로세스가 지연됩니다. "파일 제한 열기", "시간 초과"등과 같은 여러 요소 ...

관련 문제