Crontab on AIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab on AIX
# 1  
Old 05-12-2011
Crontab on AIX

Hi

I'm trying to set up a crontab on AIX and for some reason it's not running my script at the specified time - here's what I have tried so far:


Code:
30 14 * * * <scriptname>
35 14 *** /directory/<scriptname>
40,14 *** /directory/<scriptname> (nb crontab won't accept the comma)

1 and 2 look OK when I go "crontab -l", seems to be fine, but my script doesn't run... any ideas? Smilie

---------- Post updated at 07:57 AM ---------- Previous update was at 07:53 AM ----------

Hmmm seems that whoever set my environment up set it up to be 1hr ahead of the current time, do'h!!! So, I'll try to re-schedule as per the server time and not the PC time.

---------- Post updated at 08:04 AM ---------- Previous update was at 07:57 AM ----------

Alas, it didn't work... any ideas? Smilie
# 2  
Old 05-12-2011
* did you check executable permission on your script?
Code:
30 14 * * * /dir/<scriptname>

* is it working?
# 3  
Old 05-12-2011
Quote:
Originally Posted by ygemici
* did you check executable permission on your script?
Code:
30 14 * * * /dir/<scriptname>

* is it working?
I can run my script at command line with no problems, is that what you mean?
# 4  
Old 05-12-2011
i meant your script is working properly as cron entry in format?
min hour * * * /dir/<scriptname>

try this appropriate date and check your mail and cron log.
and be sure env variables already are set in your script.
# 5  
Old 05-12-2011
Quote:
Originally Posted by dbchud
Hi

I'm trying to set up a crontab on AIX and for some reason it's not running my script at the specified time - here's what I have tried so far:


Code:
30 14 * * * <scriptname>
35 14 *** /directory/<scriptname>
40,14 *** /directory/<scriptname> (nb crontab won't accept the comma)

Additionally,
1.Use full path mentioning the script location in the cron entry.
Code:
30 14 * * * /home/dir1/dir2/<scriptname>

2.Check if you are (your user name) allowed to execute cron job. The sysadmin might have included you in /etc/cron.deny file. which prohibits the user from running a cron job

Last edited by michaelrozar17; 05-12-2011 at 11:41 AM.. Reason: highlighted
# 6  
Old 05-13-2011
Cheers for the feedback. I'm working on something else at the moment (hurrah for priorities), but I'll come back to this ASAP, sometime tomorrow.

Thanks again.

---------- Post updated 05-13-11 at 07:58 AM ---------- Previous update was 05-12-11 at 10:46 AM ----------

@ygemici - Yes, I believe it's working in the format you metion, i.e. I can schedule the job by going "crontab <mycrontab>", that's alright. The problem is that when the server hits the time specified in the crontab, the script isn't executed. I'm still new to UNIX so I'll take a look into mail and cron logs.

@michaelrozar17 - I made sure to use the full path, but that seemed to have no effect. The sys admin says I have permissions to run crontab and I haven't received any error messages to suggest otherwise (well, any obvious errors).

Thanks both for the suggestions. Smilie
Code:
---------- Post updated at 09:21 AM ---------- Previous update was at 07:58 AM ----------

@ygemici -Score, got something in my mail... 

-- 
 From daemon Fri May 13 15:15:01  2011
 Received: (from daemon@localhost) by  <server>.sun.ctlmcof.fr (AIX5.3/8.13.4/8.11.0) id p4DDF15H4046954 for  <user>; Fri, 13 May 2011 15:15:01 +0200
 Date: Fri, 13 May 2011 15:15:01  +0200
 From:  daemon
 Message-Id:  <201105131315.p4DDF15H4046954@<server>.sun.ctlmcof.fr>
 To:  tallyman
 Subject: Output from cron job  /dir/<script>, <user>@<server>, exit status  126
 
 Cron  Environment:
  SHELL  =
  PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/java131/jre/bin:/usr/java131/bin
  CRONDIR=/var/spool/cron/crontabs
  ATDIR=/var/spool/cron/atjobs
  LOGNAME=tallyman
  HOME=/apps/<user>
 
 Your "cron" job executed on  <server> on Fri May 13 15:15:00 DFT 2011
 /dir/<script>
 
 
 produced the following  output:
 
 sh: /dir/<script>: cannot  execute
 
 
 *************************************************
 Cron: The previous message is the  standard output
       and standard error of one of  your cron commands.

--

Does this mean anything to you? Smilie
# 7  
Old 05-15-2011
sh: /dir/<script>: cannot execute SmilieIs it what I think it is????

Please post the output od crontab -l from your login. Note, each user has their own cron space

regards,
Ahamed
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Samba 3.6 on AIX 7.1 - Windows 10 Access to AIX file shares using Active Directory authentication

I am running AIX 7.1 and currently we have samba 3.6.25 installed on the server. As it stands some AIX folders are shared that can be accessed by certain Windows users. The problem is that since Windows 10 the guest feature no longer works so users have to manually type in their Windows login/pwd... (14 Replies)
Discussion started by: linuxsnake
14 Replies

2. AIX

Will it affect my AIX LPAR security, when i set up email alerts on AIX server.

Hello, I've set up email alerts on AIX Servers. so that i can get email notifications (via mail relay server) when ever there is abnormal behavior. for example 1) my script monitors CPU/disk/memory etc... when it reaches high water ark, it will send an email alert. 2) disk usage alerts 3)... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. AIX

Nim on AIX 7.1 used to migrate AIX 5.3 to AIX 6.1...is possible?

Using nimadm: nimadm -j nimadmvg -c sap024 -s spot_6100 -l lpp_6100 -d "hdisk1" -Y Initializing the NIM master. Initializing NIM client sap024. 0505-205 nimadm: The level of bos.alt_disk_install.rte installed in SPOT spot_6100 (6.1.3.4) does not match the NIM master's level (7.1.1.2).... (2 Replies)
Discussion started by: sciacca75
2 Replies

4. AIX

How to upgrade AIX Firmware & TL Maintenance Level in AIX

Steps to upgrade AIX TL ( technology Level ) / Maintenance Level in AIX ( including Firmware HMC VIOS ) This article or post covers upgrades for - Hardware Management Console ( HMC ) - Firmware ( also known as microcode ) - VIO ( Virtual I/O Server = PowerVM ) - AIX Version, Technology... (2 Replies)
Discussion started by: filosophizer
2 Replies

5. Shell Programming and Scripting

Sed or Awk for modify hour in a crontab AIX

Hi, I want to modifiy the hour in the crontab AIX 5.3 for this line: Input: 00 22 * * * /outillage/script_exploit/bin/SavOffline.ksh > /dev/null 2>&1 Output: 30 20 * * * /outillage/script_exploit/bin/SavOffline.ksh > /dev/null 2>&1 With the awk or sed function through a ssh -q... (1 Reply)
Discussion started by: khalidou13
1 Replies

6. UNIX for Dummies Questions & Answers

Crontab problem in AIX

Hi my script is as below. #! /bin/sh get=`ls -l *.ZIP | egrep -c '^-'` put=`cat Get_File_Count.txt|grep ''` if then echo $get > Get_File_Count.txt echo "Hi,\n\nYou've got a new feed!\n\nFilename : `ls -l *.ZIP|sort -k 6|tail -1|cut -c 58-90`" | mail -s "New File Received" user@domain.com... (8 Replies)
Discussion started by: naveen.kuppili
8 Replies

7. AIX

IY17981 fix required for aix 4.3.3 to aix 5L migration but not found

Hi, redbook documentation is telling that IY17981 fix is required for aix 4.3.3 to aix 5L migration. But there is no mention about that fix in any ML installation packages. - My system is ML11 : oslevel –r 4330-11 - But xlC.rte is on wrong version : lslpp -L xlC.rte xlC.rte ... (3 Replies)
Discussion started by: astjen
3 Replies

8. AIX

How to apply aix 5.3 TL8 properly on ML5 aix system ?

Is it necessary to put system into single user mode for applying aix 5.3 TL8 on a aix 5.3.5.0 system ? Is the TL8 installation not totally safe ? thank you. (6 Replies)
Discussion started by: astjen
6 Replies

9. AIX

crontab in AIX

Hi all, i am trying to reduce the file size of /var/adm/wtmp in my AIX servers and im using the method cp /dev/null /var/adm/wtmp to reduce it. I thought of automating it by including this command into crontab. Surprisingly, it doesn't work once i put into crontab, there is no error message thrown... (25 Replies)
Discussion started by: smallbook
25 Replies
Login or Register to Ask a Question