누군가 내가 아래의 "메타 새로 고침"을 할 때 알려 주시겠습니까? bash program-run-tmp-directory3.sh &> stdout.out &
도 다시 실행 하시겠습니까? 또는 apache
을 유지하면서 브라우저 만 새로 고칩니다.메타 새로 고침 (새로 고침 브라우저 만 사용)
"pid"은 백그라운드에서 실행되는 프로그램의 "프로세스 ID"입니다.
아래 코드가 bash program-run-tmp-directory3.sh &> stdout.out &
프로그램을 다시 실행하는 경우. 어떻게 피할 수 있는지 알려주십시오.
#!/bin/sh
echo "Content-type: text/html"
echo ""
bash program-run-tmp-directory3.sh &> stdout.out &
pid=$!
if [[ `ps -p $pid | wc -l` -gt 1 ]]
then
output="Program is running. Running time depends on the number of alternatively spliced proteins the submitted gene has. Results will be displayed here."
echo "<html>"
echo "<head>"
echo "<meta http-equiv=\"refresh\" content=\"10\"/>"
echo "</head>"
echo "<body>"
echo "<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
echo "<tr><td><img src=\"../../images/calc.gif\" align=\"absmiddle\"> <strong> $output </strong></td></tr>"
echo "</table>"
echo "</body>"
echo "</html>"
fi
감사합니다.
귀하의 질문에 서식 코드에 더 많은 노력을 넣어주세요. 코드 라인 앞에 12 개가 아닌 4 개의 공백이 필요합니다. –
특정 URL에 대한 요청을받을 때마다이 스크립트를 실행하도록 서버를 구성했다고 가정합니다. 이 경우 예, 해당 URL에 대한 요청이있을 때마다 스크립트가 다시 실행됩니다 ('bash'에 대한 내장 호출 포함). 메타 새로 고침은 브라우저에 10 초마다 페이지를 다시 가져 오도록 요청합니다. 브라우저가 지시한다면,'bash'에게 10 초마다'program-run-tmp-directory3.sh'를 실행할 것을 요청할 것입니다. –