![](/img/trans.png)
[英]Issue with subscript (script instantiated and called from another script) only running the called function, but not the entire script
[英]scrapy script called from cron only constructor called
scrapy搜尋器是通過Shell腳本調用的,該腳本在crontab條目中用作命令行。 Shell腳本如下所示:
抓取抓取targethost.com
時間到了,它確實執行了,但是似乎只調用了構造函數(我用調試輸出驗證了)。 通過將shell腳本重新編寫為:
抓取抓取targethost.com&> cronlog.log
我只是不知道為什么。
Scrapy可以正確執行,但是不會將其所有消息輸出到STDOUT,因此簡單的管道( >
)不會將所有內容重定向到您的文件中,而只是將那些內容發送到STDOUT(正如您所說的,它似乎只是構造函數) )。
使用&>
可以從scrapy中獲取所有消息,並將它們放入您的日志中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.