Cron jobs on Sun Solaris 5.10

Hi,
Following are the details of my Sun box:
SunOS ocmdf2 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V490
I am trying to set up cron job entries using the crontab file. I have copied over my crontab file from the HP-UX machine over to this Sun machine.
I have registered the file with the cron system by running the "crontab crontab.txt" command where contab.txt contains all my cron job entries. After doing so, I noticed that non of the cron jobs are getting executed. One of the cron job is given below for reference:
0 6 * * 2,3,4,5,6 . /usr/local/bin/all_roots > /dev/null 2>&1 ; ksh $TF_FEED_SRC/generate_feed_contents.com standard_feed > $TF_FEED_LOG/standard_feed.cron.log 2>&1
The above cron job entry runs fine on the HP-UX machine, but not on the Sun machine.
Following is the modified version of the above job for the Sun machine.
0 6 * * 2,3,4,5,6 (/usr/bin/ksh ". .profile ; cd /tapes/gen_scripts ; generate_feed_contents.com standard_feed > /tapes/logs/standard_feed.cron.log 2>&1")
Note that in the above modified job, the env variables like TF_FEED_SRC and TF_FEED_LOG are replaced with the actual paths and quotes and parenthesis are used.
Can somebody please advise on:
1) Why the original cron job does not run?
2) What should I do to make the original cron job run?
3) What makes the modified cron job runs?
Thanks in advance for your help.
Regards,
Shiv

ShivkumarSoni wrote:
From the above shown email, it is clear that the shell used by cron is sh and not ksh. May be this is the reason why the /usr/local/bin/all_roots script is not able to run properly and due to this the
environment variables are not getting set.That's exactly correct. From the crontab man page:
     The shell is invoked from your $HOME directory with an  arg0
     of sh. Users who desire to have their .profile executed must
     explicitly do so  in  the  crontab  file.  cron  supplies  a
     default environment for every shell, defining HOME, LOGNAME,
     SHELL(=/bin/sh), TZ, and PATH. The  default  PATH  for  user
     cron  jobs  is  /usr/bin;  while  root  cron jobs default to
     /usr/sbin:/usr/bin.  The  default  PATH  can   be   set   in
     /etc/default/cron; see cron(1M).
Can anyone help to understand what is going on here and how to fix it?Set the variables before running the program
Method 1) set in the crontab
* * * * * VAR=value /path/to/script --option=$VAR
Method 2) use a wrapper script
* * * * * /path/to/wrapper
While cron will use /bin/sh to run the line, there's nothing that keeps the wrapper script from being anything in particular (such as a ksh script).
Darren

Similar Messages

  • Cron jobs in relatio  to SAP

    Hi experts,
    can you please tell me about CRON Jobs. I searched a lot but did not found any satisfactory answer.

    Hi
    cron is a unix, solaris utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon. These tasks are often termed as cron jobs in unix , solaris
    Refer to http://www.adminschoice.com/docs/crontab.htm
    and
    http://aplawrence.com/Basics/bbcronbasics.html for more detailed info
    when you talk in relation to SAP,refer to below link
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/48bae292ab4024e10000000a1553f6/frameset.htm
    Rohit

  • Manually running a cron job in SunOS 5.8

    I was looking in the Solaris documentation and UNIX Man pages, however how do I manually run a cron job that is already set-up? I am troubleshooting an issue and the cron job runs just fine during the night, I would like to execute it manually for testing purposes. Thank you in advance.

    Run this command :
    crontab -l
    And, look for the command you want to run and then just execute it on command line. The first five columns (separated by spaces) are date/time/day (skip those), after that you will see full path of the script/program. Just copy and paste that full path on command line.

  • Should I use the built in log rolling function on iWS 6 or roll my own using a cron job using stop and start scripts in the web server instance root?

     

    Hi,
    You can use either OS cron job based log rotation
    OR
    Internal daemon log rotation.
    It is recommeded to use OS cron job log rotation.
    OS=Operating System
    Regards,
    Dakshin.
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support.

  • CRON JOb RMAN SCHEDULING

    Dear All
    I have an rman script that I am currently running manually as follows:
    run {
    allocate channel L25 type 'SBT_TAPE' format '<Direb_%u_%s_%p';
    backup
    (database include current controlfile);
    backup (archivelog all delete input);
    I would like to schedule this job to run every Sunday at 00:00. I understand that I can do this through a CRON job (I am using Solaris 8) however I am not sure how to do it. I was hoping somebody might be able to show me how to do this.
    Thanks in advance
    John

    If you want help more directly you can post your case here:
    Forums Home � Oracle Technology Network (OTN) � Technologies � Linux
    Generic Linux
    Joel P�rez

  • How to Run cron Jobs(Schduled jobs)

    HI all,
    I am runnig one webapplication in resin.In resin web.xml run at tag like below
    <run-at>01:50,03:50</run-at>This tag is used for runnig some periodic jobs.I want to cleanup the database every day at above mentiond timings.But in tomcat htere is no option like that.Is there any way to develope cron jobs please help me.
    Thanks in advance

    Do you have other tasks in cron?
    I will assume not. You have to make sure you have permissions to do cronjobs.
    If so, then just type crontab -e
    From here you can use the following guideline to make your cronjob. Also source your .profile or whatever in your shell script.
    Minute = Minute of the hour, 00 to 59. * Will indicate every minute (details later)
    Hour = Hour of the day in 24-hour format, 00 to 23. * Will indicate every hour (details later)
    Day = Day of the month, 1 to 31. * Will indicate every day (details later)
    Month = Month of the year, 1 to 12. * Will indicate every month (details later)
    Day = Day of the week, 3 chars - sun, mon, tue, or numeric (0=sun, 1=mon etc).... * Will indicate every day (details later)
    Task = The command you want to execute
    So if I had a shell script called runme.sh and in it it called my .profile (which sets my oracle_home and path etc) and it also called sqlplus and ran my script this is how I would set it up. Let's assume we want it to run 10 minutes after midnight every night.
    10 0 * * * runme.sh
    Let's assume you want a log, then it can look like this.
    10 0 * * * runme.sh 1> path/filename.log 2> path/errorlog.err
    If you wanted to just run it from Monday through Friday, then do this.
    10 0 * * 1,2,3,4,5 runme.sh
    Hope this helps.

  • Bash script with Cron job

    Hello,
    This is my first post:-)
    we have developed one script to do basic LDAP healthcheck and tested. It's working fine. But have to run manually daily. I want to put that script in cron job.
    So that it generates reports automatically. Can some one please give me the hit on it or any links which i could understand more easily.
    Thanks.

    Hi,
    this doesn't look exactly like a DS-related question, however the best option would be 'man crontab' / 'man cron' and read the man pages ;-)
    But, assuming you're running Solaris 10... and you would like to run your script every day of every month of every week at 1:30 AM... you should add the following line to your crontab:
    1 30 * * * /full/path/to/your/script.sh
    HTH,
    Marco

  • Are all Cron Jobs run by Root?

    OS : Sun OS 5.10
    I have scheduled an RMAN backup script which had only one line like
    rman target .............I logged in as os user oracle and ran this script without any issue. But when i scheduled this job to run, it didn't work.
    I got the error
    /u05/bkp_scripts/rman-level0_WM.sh: rman: not foundThe shell couldn't find rman binary in PATH. Everything worked when i explicitly set ORACLE_HOME, ORACLE_SID, PATH in the shell script.
    Does this mean a cron jobs scheduled by OS User oracle will still won't work unless you set set ORACLE_HOME, ORACLE_SID, PATH in the shell script?
    Are cron jobs handled by root user regardless of who scheduled it?

    ExpansiveMind wrote:
    OS : Sun OS 5.10
    I have scheduled an RMAN backup script which had only one line like
    rman target .............I logged in as os user oracle and ran this script without any issue. But when i scheduled this job to run, it didn't work.
    I got the error
    /u05/bkp_scripts/rman-level0_WM.sh: rman: not foundThe shell couldn't find rman binary in PATH. Everything worked when i explicitly set ORACLE_HOME, ORACLE_SID, PATH in the shell script.
    Does this mean a cron jobs scheduled by OS User oracle will still won't work unless you set set ORACLE_HOME, ORACLE_SID, PATH in the shell script?
    cron does not execute the user's .profile. You must guarantee your environment by setting it inside the script.
    Are cron jobs handled by root user regardless of who scheduled it?NO! root should NEVER be used for Oracle tasks. root should never be used for anything that can be done by another account.

  • Specify user in cron job

    Solaris 9
    I have an application that when I run a script against it, using a cron job, the script pulls the name of the user running the cron (at least that is what it seems to be doing). I cannot make root a user in that application but I have to run the cron as root (auditor requirement).
    How can I specify the username in my cron? I do not see a cron.daily, or anywhere to load my script, so I can specify the user.
    TIA

    I should have said the root cron rather than my cron. I tried this in the crontab -e, while logged in as root:
    30 4 * * 1-5 myusername /home/user/script
    I am thinking there is a way to specify a user other than root in root's cron job.
    TIA

  • Urgently require a Programmer for TOP Dubai Co. (Oracle on Sun Solaris)

    Need a good integration programer, experienced on Oracle Database, and Sun Solaris operating system. Budget is Dhs 8,000 per month Negotiable, depending on the experience. ( For a leading Dubai Company) - Revert back with detailed CV NOW........
    Appointment in a week.
    Location - Dubai UAE
    Sadsack
    00 91 98 60 225 225
    [email protected]

    Maybe there should be a category like "job offers" in this forum?
    As a side note: maybe add some more details next time, such as: which version of Oracle products, which kind of operating system skills (I read programmer as developer, not as administrator), etc.
    C.

  • Help needed on installation of Oracle 9i on Sun Solaris 8

    Hey,
    Help needed on installation of Oracle 9i EE on Sun Solaris 8. The problem I met was: we followed the installation guide from the documentation. And we selected the choice "install software only". After it was done successfully, we run Database Configuration Assistant utility to create a database instance. But finally it always tried to create the instance at the root directory ( / ) which doesn't have enough space and then failed. The case was that we have set the enviroment parameters: $ORACLE_BASE = /export/mydata, $ORACLE_HOME = /export/apps/oracle9i. That means it should be installed at /export/mydata, but it didn't. Any help or advice are welcome. Thanks.
    Simon

    I have downloaded Oracle 11G R2 version from Windows and extracted it in Windows and copied it into DVD after extraction in two folders. Now I am mounting that DVD in Solaris 10 installed in my VMware . I made a new directory named as 'installation ' under /export/home/oracle and copied the folders from DVD to 'installation' folder. Now I am entering installation folder and try to do ./runInstaller as 'oracle ' user and getting the error mentioned before.
    Edited by: 916438 on Mar 31, 2012 5:55 PM

  • Help needed on installation of Oracle 9i EE on Sun Solaris 8

    Hey,
    Help needed on installation of Oracle 9i EE on Sun Solaris 8. The problem I met was: we followed the installation guide from the documentation. And we selected the choice "install software only". After it was done successfully, we run Database Configuration Assistant utility to create a database instance. But finally it always tried to create the instance at the root directory ( / ) which doesn't have enough space and then failed. The case was that we have set the enviroment parameters: $ORACLE_BASE = /export/mydata, $ORACLE_HOME = /export/apps/oracle9i. That means it should be installed at /export/mydata, but it didn't. Any help or advice are welcome. Thanks.
    Simon

    I have downloaded Oracle 11G R2 version from Windows and extracted it in Windows and copied it into DVD after extraction in two folders. Now I am mounting that DVD in Solaris 10 installed in my VMware . I made a new directory named as 'installation ' under /export/home/oracle and copied the folders from DVD to 'installation' folder. Now I am entering installation folder and try to do ./runInstaller as 'oracle ' user and getting the error mentioned before.
    Edited by: 916438 on Mar 31, 2012 5:55 PM

  • Installation problem sun solaris 9 x86 on intel

    I am trying to install sun solaris 9 x86 intel platform edition on my home pc hp e-vectra, configuration is PIII 800 Mhz, 10 GB HDD, 128 MB Ram, 17" color monitor, but it giving me following error :-
    BooT Panic: trap type e, error 0 at 117499
    Cr0: 800000011, cr1: 4, cr3: 17e000
    Eax: 0, ebx: 7e2c, ecx: 0 edx: 16e350
    Es: fffffffe, edi: 17dfe0, ebp: 7e40, esp: 7e20
    Entering boot debugger:
    Please help me, how can I install sun solaris 9 x86 on my HP E-Vectra PC.
    Kalpesh Mehta

    I had similar problems several months ago. I suspect this happens when host pc does not have floppy drive(or bios somehow misreports it) as it was in my case. Solaris 8 seems to work fine in the same environment, so I keep using it for now. Possible workaround might be to use DCA from Solaris 8: Installation of Sol9 started just fine after I entered Sol8 DCA and asked it to boot from Sol9 CD.
    Hope this problem will be fixed in subsequent Sol9 releases.
    Victor

  • Sun Solaris 10 installation problem on IBM ThinkPad R31Notebook

    Hello,
    I have tried to install Sun Solaris 10 on my IBM ThinkPad R31 notebook, but the system has problem at initial stage of loading the installation software from CD. Here is the message I see on the screen when the CD is loaded:
    loading stage2 ....
    GNU GRUB Version 0.95 (639K lower / 514880K upper memory"
    Solaris
    Solaris Serial Console ttya
    Solaris Serial Console ttyb (for 1x50, v60x and v65x
    SunOS Release 5.10 version Generic_118855-33 32-bit
    Copyright 1983-2006 Sun Microsystems, Inc All Right reserved
    Use is subject to license terms
    Rebooting
    Rebooting
    Rebooting
    Rebooting
    Rebooting
    Rebooting
    Rebooting
    Rebooting
    I changed both memory and the hard drive but I still have the same problem. Can anyone please tell me what the problem might be or what remedial step I should take to install Solaris 10 on R31?
    Thanks

    Did you try install check CD before the installation?
    I think that there might be two main reasons:
    1. Your computer is not supported
    2. Hard drive may need to be formated to FAT32 or UFS

  • Portal Installation Problem on Sun Solaris

    Hi,
    I'm trying to Install portal (Oracle 9i AS ) on Sun Solaris 2.8 (64 bit). I have followed all the steps and installer show successfull installation. But when I'm trying to check the installation thru web browser, I'm not getting anything. It is not able to load portal. Please let me know do I need to start any listener or anything else.
    What else should I do to check the mistakes because I have installed it twise but no luck.
    Thanks.
    Sandeep

    I am having the same problem installing on Windows 2000. I looked at the services that were installed and two of the ones that were marked as Automatic did not start when I rebooted. They are:
    OracleiSuitesHTTPServer
    OracleOraHome81TNSListener
    I also tried to start the HTTP server from the command line but got the following error:
    D:\Oracle\iSuites\Apache\Apache>apache
    Syntax error on line 14 of D:\Oracle\iSuites\Apache\Apache\conf\mod__ose.conf:
    AuroraService - directive already in effect for this Server
    If anyone has a solution please let me know. I had a hard enough time trying to get through the installation at all.
    Thanks,
    -Stephanie
    null

Maybe you are looking for

  • Computer won't boot, all I get is a black screen

    I'm using Vista home premium and everything was working fine up until the other day. My computer froze up and I shut it down to restart. Upon restarting, I was given the option to start windows normally or in safe mode. I selected to start up windows

  • OSX Lion cannot be installed on used macbook pro

    Dear all, I inherited an old used macbook pro (2009 model) from a colleague.  He cleaned it and it was ready to reinstall when I received it.  I purchased a new OSX Lion set to install.  As the macbook is a present for my daughters birthday, I purcha

  • How do i delete apps from itunes so they never download again?

    How do I delete apps from itunes so they never download again?

  • Here is an odd one

    my brother-in-law in maine just got verizon DSL (after suffering with dial-up for a long time). connects to the internet fine. mail works fine. firefox works just fine. but safari will not connect. if he tries www.apple.com he gets apple.com server n

  • Lost Site Definitions

    Hi All, Using Dreamweaver CS3 & Mac OS 10.4.11, so no Time Machine Opened DW this morning and ALL site definitions gone. Have some of them backed up to .ste so can recover them easily, only about 25% though. Any ideas? Thanks Niall