我有一个快速的问题。我需要使用自动 shell 脚本向 debain crontab 添加一个 cron,我需要 cron 做两件事:
crontab -l | { /bin/cat; /bin/echo "* 3 * * * cd /etc/application"; } | crontab -
我如何让它也运行scrapy crawl命令?
最佳答案
您可以在单个 crontab 行中包含多个命令。只需用分号分隔它们:
crontab -l | { /bin/cat; /bin/echo "* 3 * * * cd /etc/application ; scrapy crawl"; } | crontab -
关于shell - 使用 crontab 运行两个命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18367711/