Linux Crontab命令分隔行
我有两个python脚本:Linux Crontab命令分隔行,linux,shell,cron,Linux,Shell,Cron,我有两个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 > /ephem
#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
我将this命令放在crontab中,想知道如何将这个长命令写入两行或三行。类似于下面的python行分隔符示例,但用于Crontab命令,因此更具可读性:
>>> print \
... 'hel\
... llo'
helllo
不,你不能那样做。从手册页: 无法将单个命令行拆分为多行, 就像shell的尾部“\”一样 您可以将命令放入脚本中并运行它