내 문제는 :php exec를 사용하여 최신 화면 만 출력하는 방법은 무엇입니까?
나는 exec 명령으로 생성 된 큰 출력 파일이 있습니다. 매초마다 텍스트 파일에 추가되기 때문에 약 800-1500MB의 텍스트 출력이 있습니다. 마지막 부분을 텍스트 파일에만 어떻게 쓸 수 있습니까?
saving: Test torrent (1115.9 MB)
percent done: 19.8
time left: 22 min 04 sec
download to: /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/uid1_fil_1370552248/
download rate: 1344.1 kB/s
upload rate: 115.7 kB/s
share rating: 0.121 (26.8 MB up/221.3 MB down)
seed status: 81 seen now, plus 3.994 distributed copies
peer status: 18 seen now, 45.3% done at 2175.4 kB/s
그리고 안 함 :
saving: Test torrent (1115.9 MB)
percent done: 19.8
time left: 22 min 04 sec
download to: /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/uid1_fil_1370552248/
download rate: 1344.1 kB/s
upload rate: 115.7 kB/s
share rating: 0.121 (26.8 MB up/221.3 MB down)
seed status: 81 seen now, plus 3.994 distributed copies
peer status: 18 seen now, 45.3% done at 2175.4 kB/s
saving: Test torrent (1115.9 MB)
percent done: 19.8
time left: 22 min 04 sec
download to: /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/uid1_fil_1370552248/
download rate: 1344.1 kB/s
upload rate: 115.7 kB/s
share rating: 0.121 (26.8 MB up/221.3 MB down)
seed status: 81 seen now, plus 3.994 distributed copies
peer status: 18 seen now, 45.3% done at 2175.4 kB/s
saving: Test torrent (1115.9 MB)
percent done: 19.8
time left: 22 min 04 sec
download to: /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/uid1_fil_1370552248/
download rate: 1344.1 kB/s
upload rate: 115.7 kB/s
share rating: 0.121 (26.8 MB up/221.3 MB down)
seed status: 81 seen now, plus 3.994 distributed copies
peer status: 18 seen now, 45.3% done at 2175.4 kB/s ...etc...
이
$cmd = 'btdownloadheadless --saveas /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/'.$kovNev.'/ '.$_REQUEST["torrent"];
exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $cmd, $outputfile, $pidfile));
내 출력 파일에이를보고 싶다 :
이
내가 지금하고 있어요 어떻게 따라서 최신 화면 만보고 싶습니다. 내 bash 명령은 출력 txt를 다시 쓰지 않고 추가합니다. 나는 그것을 다시 쓰고 싶다.
나는 이것을 발견했다 : http://tldp.org/LDP/abs/html/io-redirection.html이 bash 일에 관한 글이지만, 왜 내 bash 스크립트가 그 txt를 덧붙이는지 이해하지 못한다. 그것을 지우고 새로운 것을 생성하십시오. –
'$ cmd'에 어떤 명령이 있고'마지막 부분 데이터 '로 무엇을 의미합니까 :'$ cmd'의 마지막 행,'$ cmd' 또는' $!'? – Samveen
'$ cmd = 'btdownloadheadless --saveas /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/'.$kovNev.'/'. $ _REQUEST [ "torrent"];'... 이것은입니다. 내 cmd $ _REQUEST [ "torrent"]는 토런트 파일의 URL입니다. –