Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Multiple Sequential Commands in CRON Linux

If the running commands depend on each other, we can use double ampersand 
(&&) between them. As a result, the second command will not be executed 
if the first one fails.
$ * * * * * /path/to/command-1 && /path/to/command-2

We can run several commands in the same cron job by separating them with a semi-colon (;).
$ * * * * * /path/to/command-1; /path/to/command-2
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #Multiple #Sequential #Commands #CRON #Linux
ADD COMMENT
Topic
Name
3+4 =