How to run multiple cron jobs?


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers How to run multiple cron jobs?
# 1  
Old 09-20-2017
Question How to run multiple cron jobs?

I have two scripts which I'm tying to run one after the other- this is what I've tried:

Code:
00 14 * * * /path/one.sh && /path/two.sh

I've also tried putting each script on a different line:

Code:
00 14 * * * /path/one.sh
00 14 * * * /path/two.sh

Can this be done?
# 2  
Old 09-20-2017
You first sample is correct.
It runs the second script after the first one, if the exit status was zero (ok).
To unconditionally run the second script
Code:
00 14 * * * /path/one.sh; /path/two.sh

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to read file and run multiple jobs

I have a txt file line1 line2 line3 $!/bin/sh cat /tmp/lus.txt | while read line do esxcli storage vmfs unmap -u $lin -n 4000 done this works but does in one line at a time. how do I do all lines at once simutaeously? Please use CODE tags as required by forum rules! (4 Replies)
Discussion started by: tdubb123
4 Replies

2. Shell Programming and Scripting

Shell script to run multiple jobs and it's dependent jobs

I have multiple jobs and each job dependent on other job. Each Job generates a log and If job completed successfully log file end's with JOB ENDED SUCCESSFULLY message and if it failed then it will end with JOB ENDED with FAILURE. I need an help how to start. Attaching the JOB dependency... (3 Replies)
Discussion started by: santoshkumarkal
3 Replies

3. Shell Programming and Scripting

How to View multiple Cron jobs

Hi, I ran two crontab commands using: crontab program1 crontab program2 However when I type crontab -l only the second cron job shows up, how do I see all cron jobs running and how do I edit all at the same time Thanks in Advance S:D (10 Replies)
Discussion started by: walforum
10 Replies

4. Shell Programming and Scripting

General Q: how to run/schedule a php script from cron jobs maybe via bash from shell?

Status quo is, within a web application, which is coded completely in php (not by me, I dont know php), I have to fill out several fields, and execute it manually by clicking the "go" button in my browser, several times a day. Thats because: The script itself pulls data (textfiles) from a... (3 Replies)
Discussion started by: lowmaster
3 Replies

5. UNIX for Dummies Questions & Answers

Re : Set multiple cron jobs in one crontab file

Hello All, Hopw all is fine. I am newbie to Unix. I am using Bourne Shell (sh). One of the question I have is that I am trying to read XML file and based on reading that XML file I want to run different java programs at different hours. Meaning 05 14 * * * java ./program1 10 14 * * * java... (3 Replies)
Discussion started by: samshaw
3 Replies

6. Shell Programming and Scripting

1 script or multiple scripts?? - check files, run jobs

Question for anyone that might be able to help: My objective is to eheck if a file (a source file) exists in a directory. If it does then, I'd like to call an application (Informatica ETL file...not necessary to know) to run a program which extracts data and loads it into multiple targets. ... (6 Replies)
Discussion started by: jnanasakti
6 Replies

7. AIX

comment jobs in cron for multiple accounts

Hi, We have several jobs scheduled in cron in AIX. Before every release we need to comment those jobs and uncomment those after the release is over. There are several accounts whose cron entries need to be commented. Can anyone provide me with a script which can put a '#' before each line in... (3 Replies)
Discussion started by: shibajighosh
3 Replies

8. UNIX for Dummies Questions & Answers

Please help me with the run-away cron jobs

I started a cron job on a cluster super computer. I am just a usual user over there and has no root power. The cron job was set by using "crontab -e". It excecutes a perl command every 20 minutes. I could use crontab -l or crontab -r to list or remove the cron job. However, I just found that I... (2 Replies)
Discussion started by: dedema
2 Replies

9. Shell Programming and Scripting

background jobs exit status and limit the number of jobs to run

i need to execute 5 jobs at a time in background and need to get the exit status of all the jobs i wrote small script below , i'm not sure this is right way to do it.any ideas please help. $cat run_job.ksh #!/usr/bin/ksh #################################### typeset -u SCHEMA_NAME=$1 ... (1 Reply)
Discussion started by: GrepMe
1 Replies

10. Linux

cron jobs not run

hi, I am newbie, I had set cron jobs to update something on one time very day, I had tested the script, it run fine, but the cron jobs seem never run. some help? Thanks. (4 Replies)
Discussion started by: robertsnoog
4 Replies
Login or Register to Ask a Question