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

Share:
8,137

Related videos on Youtube

Daryl
Author by

Daryl

Updated on September 18, 2022

Comments

  • Daryl
    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
      Josh about 11 years
      Why not create a shell script which just calls them all?
    • Jenny D
      Jenny D about 11 years
      This 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
      NickW about 11 years
      There 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
      Daryl about 11 years
      I 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
    Josh about 11 years
    You 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.