【发布时间】:2013-09-10 18:33:37
【问题描述】:
我有两个 python 脚本:
#1. getUrl.py # used to collect target urls which takes about 10 mins and used as the input for the next script
#2. monitoring.py # used to monitoring the website.
00 01 * * * /usr/bin/python /ephemeral/monitoring/getUrl.py > /ephemeral/monitoring/input && /usr/bin/python /ephemeral/monitoring/monitoring.py >> /ephemeral/monitoring/output
我把这个命令放在 crontab 中,想知道我怎么能把那个长命令写成两三行。类似于下面的 python 行分隔符示例,但用于 Crontab 命令,因此更具可读性:
>>> print \
... 'hel\
... llo'
helllo
【问题讨论】: