PDA

View Full Version : can't run crontab on virtual machine yet can run in acutaa



slesmaster
27-Apr-2015, 12:21
Hi all,

I can run as a non root user, oracle in a 64 bit SLES 11 SP3 server (not virtualized, actual server), but not in a 32 bit SLES 11 SP3 Server (virutal server). Why is this so?

here's the information




oracle@vmsuperb:/opt/oracle $ ps -el | grep cron
1 S 0 7024 1 0 80 0 - 614 ? ? 00:00:45 cron






grep -i cron /var/log/messages
May 23 14:45:35 vmsuperb crontab[1683]: (oracle) LIST (oracle)
May 23 17:42:51 vmsuperb crontab[11045]: (oracle) REPLACE (oracle)
May 23 17:42:53 vmsuperb crontab[11046]: (oracle) LIST (oracle)
May 23 17:54:13 vmsuperb crontab[11449]: (oracle) BEGIN EDIT (oracle)
May 23 17:54:47 vmsuperb crontab[11449]: (oracle) REPLACE (oracle)
May 23 17:54:47 vmsuperb crontab[11449]: (oracle) END EDIT (oracle)
May 23 17:54:52 vmsuperb crontab[11455]: (oracle) LIST (oracle)
May 23 23:55:01 vmsuperb /usr/sbin/cron[7024]: (oracle) RELOAD (tabs/oracle)
May 23 18:08:55 vmsuperb crontab[11937]: (oracle) LIST (oracle)
May 23 18:08:59 vmsuperb crontab[11938]: (oracle) BEGIN EDIT (oracle)
May 23 18:10:01 vmsuperb crontab[11954]: (oracle) LIST (oracle)
May 23 18:11:46 vmsuperb crontab[12030]: (oracle) LIST (oracle)
May 23 18:12:12 vmsuperb crontab[12047]: (oracle) LIST (oracle)
May 23 18:12:41 vmsuperb crontab[11938]: (oracle) REPLACE (oracle)
May 23 18:12:41 vmsuperb crontab[11938]: (oracle) END EDIT (oracle)
May 23 18:12:44 vmsuperb crontab[12053]: (oracle) LIST (oracle)
May 23 18:12:49 vmsuperb crontab[12054]: (oracle) LIST (oracle)
May 24 00:13:01 vmsuperb /usr/sbin/cron[7024]: (oracle) RELOAD (tabs/oracle)







root@vmsuperb:/root $ rccron status
Checking for Cron: running
root@vmsuperb:/root $



content of shell script in /opt/oracle/scripts/backup/helloworld.sh




echo "hello world" > /opt/oracle/scripts/backup/helloworld.log


When I run the code





oracle@vmsuperb:/opt/oracle $ /opt/oracle/scripts/backup/helloworld.sh
oracle@vmsuperb:/opt/oracle $ ls -l /opt/oracle/scripts/backup/helloworld.log
-rw-rw-r-- 1 oracle oinstall 12 May 23 18:44 /opt/oracle/scripts/backup/helloworld.log
oracle@vmsuperb:/opt/oracle $ date
Sat May 23 18:44:20 MEST 2015




I've no issues at all.

but when I put inside the crontab



oracle@vmsuperb:/opt/oracle/scripts/backup $ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXMjQVry installed on Sat May 23 18:46:24 2015)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
48 18 23 05 * /opt/oracle/scripts/backup/helloworld.sh >&1




later I discover something.....
when I tail /var/log/messages I got the following message




May 23 19:03:25 vmsuperb crontab[13518]: (oracle) REPLACE (oracle)
May 24 01:04:01 vmsuperb /usr/sbin/cron[7024]: (oracle) RELOAD (tabs/oracle)




Why is my code scheduled to run 6 hours later


My code never even got run as scheduled. Is there any way to resolve this issue? thanks a lot!

ab
27-Apr-2015, 14:06
I'd probably check to see if oracle is in either /etc/cron.allow or
/etc/cron.deny as being in the latter means the user cannot run cron jobs,
and beingin the former may be a simple test though I do not think it
should be required (by default SUSE's cron system allows most users to run
jobs).

Why is your date a month in the future?

Also, while still testing, setting up your job to run every minute may get
you faster results so you're not waiting several hours to test basic
functionality.


--
Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below...