Why does crontab -l command always show only the "latest scheduled" cron job, I wish to display all cronjobs that have been scheduled not just the latest one. How do you do this?
If you are using crontab -e and entering one job, then saving the file, and then invoking crontab again to enter the "next" job you will have problems.
The crontab file is a list of all scheduled jobs. When you edit it using crontab -e you need to add all of your jobs in the edit session, not just one. So your file will look something like this to run two jobs at the desired time (just past midnight and 8am in this example):
When you edit the file again, you will see all of the jobs and you can either add to them, modify them, or delete one or more jobs. Then save the file.
Make sure that you have no blank lines in the file. You might want to read the manual page for both crontab(1) and crontab(5).
If you are using crontab -e and entering one job, then saving the file, and then invoking crontab again to enter the "next" job you will have problems.
Why would that be a problem? As long as the file is saved...
@OP: That may be your problem -- are you saving the crontab after editing? What editor are you using? Have you tried the suggestion posted above with setting the EDITOR var?
Why would that be a problem? As long as the file is [I]saved...
I assumed that the OP was saving just one line at a time and not all jobs. Might not be, but that's the only way I could think to explain why crontab -l wasn't listing all jobs.
I have two scripts which I'm tying to run one after the other- this is what I've tried:
00 14 * * * /path/one.sh && /path/two.sh
I've also tried putting each script on a different line:
00 14 * * * /path/one.sh
00 14 * * * /path/two.sh
Can this be done? (1 Reply)
How to view the cron jobs that ran on kinit i keep getting must be privileged to use -u
this is the control used,
echo 'cat /usr/local/bin/tpthadoop/secret/hadoop.txt' | kinit hdfs
what happens with above command kinit is using kerberos and the account used to run the processes jobs are... (1 Reply)
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)
There are two jobs in Solaris , Cron and at jobs..
I know how to disable or enable cron jobs.
How can I enable at jobs and disable it.
Kindly help.
Rj (2 Replies)
Hi,
We have a group of hosts using which the cron jobs are submitted...
Few days ago i had submitted a cron job in of these hosts, but unfortunately forgot the host name :(
Can anyone please help me out in finding this host name from which the cron s submitting the job, i dont want the... (2 Replies)
I need to start a job every friday night at 8:00 P.M , it runs all the day on Sat and Sun....can somebody tell me how to do this...I understand crontab...but haven't used it.........can u write some steps.....how to create a file and call.....I honestly dont know? Plz help.Thanks (2 Replies)
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)
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)
i am new for cronjobs
can someone please tell me what logic is behind these RED Numbers and stars below?
--> crontab -l
00 1 * * * /home/scripts/TarprodContent > /tmp/MprodBkup.log 2>&1
00 1 * * * /home/scripts/TarTprodContent > /tmp/TprodBkup.log 2>&1
00 1 * * *... (5 Replies)
I need to monitor my cron jobs with another unix machine since occasionally the cron will go down on the main server but there are no errors. Can anyone help with a script to write to use the cron on the back up machine to monitor the main server?
I am using SCO and the cron jobs have been... (3 Replies)