Cron on AIX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Cron on AIX
# 1  
Old 03-28-2011
Cron on AIX

Hello,

First, a brief background: I'm fairly comfortable with working from the command line, having done so for a while in Mac OS X, but I have recently been asked to assist with an AIX system.

There is currently a backup script that is set to run via Cron, and I would like to change the interval at which it runs. I know that normally this is done with Crontab, but the problem is that I don't know which tab file actually has the entry for this job, as a previous IT department set it up.

What I've found: /var/spool/cron/crontabs contains the usual files you'd expect, each named after the user that created them, but also some others: root_bad (which contains junk), root.tools.10417 (among other root.tools.othernumber files), etc. Only a few of the root.tools.* files have an entry referring to the backup script, but my understanding is that a Crontab file had to be named for a user. Is my thinking here correct, or is it possible that Cron is actually using these files?

Thank you!
# 2  
Old 03-29-2011
The cron file would have to match a user in /etc/passwd to be processed The duff ones may even be generating errors in the cron log file if logging is switched on (default is /var/adm/cron/log on AIX). You will need to consider when it runs and try to find a suitable record in the files you have found. Remember that the format of a cron record is:
Code:
mi hh dd mn dw command

Where mi is minutes past the hour
and hh is the hour of the day
then dd mn defines day of month and month critera
which is or-ed with the Day of Week value.

With this last thing in mind, it is possible to do some very confusing things (as I know to my cost) where you think you have set a job to run on every first Monday of the month (Day of month 1-7, Month of * and Day of week 1) but what you get is every day from 1-7 AND every Monday.

You will need to trace what each active line does for each file with an associated user account. No easy way to do this I'm afraid. Perhaps switching cron to log may help, or rather removing the flag that stops it logging.





I hope that this helps
Robin
Liverpool/Blackburn
This User Gave Thanks to rbatte1 For This Post:
# 3  
Old 03-29-2011
Bug Cron on AIX

Hello,
The best way to modify the crontab is to use (editor like vi, but it will refresh the cron demon ): crontab -e
This will check the consistency of the date format.
crontab -l to list the content, or crontab -l <user>
All other files that don't belong to a user from /etc/password in the folder /var/spool/cron/crontabs can be delete, it's normally not the best place to store scripts.
# 4  
Old 03-30-2011
Thanks! I've got the backups running as I wanted now, and I'll be sure to move the junk files somewhere else.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

AIX cron job is running everyday instead of on a particular day

Hello, I was trying to run a script on a dev server using cron job. It supposed to run 3rd sunday of every month. 45 4 15-21 * 0 /home/user1/myscript.sh >/dev/null 2>&1 # run this script 3rd sunday of every month When I Schedule it on AIX server, It is running every day at 4:45 AM. am I... (3 Replies)
Discussion started by: Kumar7997
3 Replies

2. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

3. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

4. Shell Programming and Scripting

Cron job is not working in the desired manner on IBM AIX

Hi, I have created a cron job on IBM AIX but it is not working in desired manner ! Here are the steps which I have followed :- #!/bin/ksh #------------------------------------------------------------------ find /some/file/at/the/user/side/test.log -exec cp {}... (8 Replies)
Discussion started by: acidburn_007
8 Replies

5. AIX

AIX power problem cron message on screen

Hello, I keep getting this message even after i removed it from the cron enteries it was added automatically Broadcast message from root@oradb (tty) at 12:00:00 ... rc.powerfail:2::WARNING!!! The system is now operating with a power problem. This message will be walled every 12... (2 Replies)
Discussion started by: filosophizer
2 Replies

6. Shell Programming and Scripting

Using expect script with AIX's SMIT in cron

My searches turned up nothing relevant, so I apologize if this has already been looked at. I am trying to run an expect script from a Solaris machine, that ssh's into an AIX machine, and interacts with a SMIT created menu system that runs a few backups for me. The expect script runs fine when... (0 Replies)
Discussion started by: Mariognarly
0 Replies

7. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

8. AIX

cron jobs in aix

please can u tell me how to use the crontab commad in aix plz give some exemple it will be better if u give me the option of cron in aix (1 Reply)
Discussion started by: alokjyotibal
1 Replies

9. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies

10. UNIX for Dummies Questions & Answers

aix cron job

I have problem with AIX v4.3.3 to run the cron job: Please advise me on the above : 1 -) I need to run a backup for full system at 23:59, : crontab -e 59 23 * * * /usr/bin/mksysb -i /dev/rmt0 > /dev/null 2>&1 2 -) I need to run a spesific command at 23:59: crontab -e 59 23 * * *... (6 Replies)
Discussion started by: jinggo
6 Replies
Login or Register to Ask a Question