1 and 2 look OK when I go "crontab -l", seems to be fine, but my script doesn't run... any ideas? :o
---------- 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 ----------
Additionally,
1.Use full path mentioning the script location in the cron entry.
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
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.
---------- 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.
Is it exactly like this? Shouldn't you replace directory and <scriptname> appropriately? That is what the error says or did you edit it to keep it confidential? Sorry if I am mistaken.