*/10 * * * * /usr/bin/flock -x -w 10 /tmp/craigslist.lock /usr/bin/lynx -width=120 -dump "http://sfbay.craigslist.org/search/roo/sfc?query=&srchType=A&minAsk=&maxAsk=1100&nh=6&nh=8&nh=16&nh=24&nh=17&nh=21&nh=22&nh=23&nh=27" | grep "sort by most recent" -A 53 > /home/winchell/apartments.txt
*/10 * * * * /usr/bin/flock -x -w 10 /tmp/craigslist.lock /usr/bin/php /home/winchell/apartments.php
这是一项计划任务。即使 lynx 正在写入 apartments.txt,第二行 php 命令似乎也在执行,我看不出原因。假设我在 lynx/grep 正在写入时试图阻止从 apartments.txt 中读取,这是正确的用法吗?谢谢!