Separate Crontab Team Line

I have two python scripts:

#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 

I put this command in crontab and wondered how I can write this long command on two or three lines. Something like the python line separator example below, but for the Crontab command, so this is more readable:

 >>> print \ ... 'hel\ ... llo' helllo 
+18
source share
1 answer

No, you cannot do this. On the man page:

It is not possible to split one command line into several lines, like a shell ending with "\".

You can put commands in a script and run it.

+34
source

Source: https://habr.com/ru/post/1500957/


All Articles