Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Crontab命令分隔行_Linux_Shell_Cron - Fatal编程技术网

Linux Crontab命令分隔行

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

我有两个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
我将this命令放在crontab中,想知道如何将这个长命令写入两行或三行。类似于下面的python行分隔符示例,但用于Crontab命令,因此更具可读性:

>>> print \
... 'hel\
... llo'
helllo

不,你不能那样做。从手册页:

无法将单个命令行拆分为多行, 就像shell的尾部“\”一样

您可以将命令放入脚本中并运行它