Running multiple cron jobs from single script
8,137
you can use article "&" for parallel work and "&&" step-by-step launch script
#script.sh & script2.sh & script.sh
more info at http://www.gnu.org/software/bash/manual/bashref.html#Lists
Related videos on Youtube
Author by
Daryl
Updated on September 18, 2022Comments
-
Daryl over 1 year
I have three different jobs that I want to run from the FreeBSD shell. I would like to consolidate them into a single script, if possible, but I can not find any syntax to do that. Is there someway I can accomplish this?
-
Josh about 11 yearsWhy not create a shell script which just calls them all?
-
Jenny D about 11 yearsThis question needs a lot more information for anybody to be able to help you. What do you mean by "different jobs"? What have you tried? What has failed, and how?
-
NickW about 11 yearsThere are a myriad of was to run multiple "jobs", simplest of all is end the command with a ; then type the next one, etc.
-
Daryl about 11 yearsI apologize for not being descript. I have 3 different commands I want to run at different times. I want to have all three commands be in a single script, but still have cron run them at different times.
-
-
Josh about 11 yearsYou can also run multiple commands by separating them with
;
which will rul all the commands regardless of their return value.&&
will only continue to run if the previous command was successful.