Cron jobs not always run

I have cron jobs which do not always run. Has anyone had this problem. These are simple executables which may run one day, but not the next. Very puzzling.

415/2861
Here's in detail how/why it works this way
(and so far still the same in 10.4.4 I think):
A simple example:
http://discussions.apple.com/message.jspa?messageID=1320152#1320152
Peter Sealy:
http://discussions.apple.com/message.jspa?messageID=1384836#1384836
Dr. Smoke:
http://discussions.apple.com/message.jspa?messageID=1362594#1362594
The problem is that they are delayed by sleeps.

Similar Messages

  • Cron job not running - script uses rsync, ssh (with id_rsa)

    Does anyone know how to get cron to run a rsync/ssh script which uses id_rsa for passwordless logins?
    I have a backup script I have slaved for months over that works wonderfully when running it from the command line.
    It uses rsync and connects with SSH (passwordless using ssh keys). I have setup id_rsa and id_rsa.pub for passwordless logins (this is my user account, and connects using root@ to the server)
    As stated all works find when run from the command line. But when I setup a cron job to run this file (exact same line I run from the command line) it does not execute. Actually, it does run, as I have an email notifiction which sends to me. It is just the rsync/ssh part that does not run.
    I have spent days and days trying to figure it out. No error messages occur, nothing.  Took me a while to find out cron is emailing the user account on Lion the messages (not to a proper email address).
    The error shows a permission denied, which I believe to be the cron user cannot use the id_rsa/ssh connection.
    Cron is running the script as my user, the same I use on the command line. I even tried copying the id_rsa to the root user .ssh folder in case cron is running as root but that does not work either.
    So does anyone know how to get cron to run this rsync/ssh script which used id_rsa for passwordless logins?
    Thanks a lot

    YES! Got it working, finally!
    So the issue is indeed cron/launchd not being able to access the ssh-agent which holds the key.
    So this is the solution...
    Download keychain for Mac:
    http://www.funtoo.org/wiki/Keychain
    Then once its installed and configured, the script to run needs this added to the top:
    eval `keychain --noask --eval id_rsa` || exit 1
    Note I am using id_rsa whereas keychains instructions refer to id_dsa so I just changed it and it works OK.
    When the script runs the first time it asks for the key password. Then it works from then on.
    What I do not know yet is will I need to re-enter the password when I logoff/logon again. That will cause an issue as I auto restart the Mac every day which means if I am off for a few days backup will stop (can you see the madness in this issue!).

  • Running Applescript using cron jobs not working

    I'm new to conjobs and applescript but I have the script done correctly i believe. (any critique is welcome) I don't want to bloat my calendar with events to do this because I use my calendar for appointments and I don't need the bloat.
    Here's my goal: run an apple script at 9am/5pm to enable/disable a mail account (after this works I'm going to add loging in/out of an Messenger account, first things first)
    here's my script:
    tell application "Mail"
              set offTime to 17
              set onTime to 9
              set dayOfWeek to weekday of (current date)
              set theHour to get the (hours of (current date)) as string
              if theHour ≥ onTime then
                        say "email on"
                        set enabled of account "MAILBOX" to true
              else if theHour ≥ offTime or (dayOfWeek = Saturday or dayOfWeek = Sunday) then
                        say "email Off"
                        set enabled of account "MAILBOX" to false
              end if
    end tell
    accessing cron jobs via this
    sudo pico /etc/crontab 
    and within cron jobs i've used
    0 9 * * * username osacript
    "/Documents/disablemail.scpt"
    0 17 * * * username osacript
    "/Documents/disablemail.scpt"
    variations I've attempted (based on search engine results)
    0 9 * * * username osacript
    "~/Documents/disablemail.scpt"
    0 9 * * * /Documents/disablemail.scpt
    0 9 * * * ~/Documents/disablemail.scpt
    0 9 * * * osacript /Documents/disablemail.scpt
    0 9 * * * osacript ~/Documents/disablemail.scpt
    I think that's all of them.
    Any feedback/assitance appreciated, thanks!

    What's the problem, is the cronjob not getting called at all or is the script giving errors?
    One problem you have right off is the cron job you have set up is running as root not as you.

  • User cron jobs won't run without home directory

    I have a situation where the users are defined through ldap without home directories, but our application creates cron jobs for these users. If a home directory is defined, the cron jobs run. If no home directory is defined, the cron jobs will not run. Is there a way to configure cron to use a global home directory, instead of the user's home directory?
    Kevin

    The crontab man page says that cron changes to the users home
    directory and then sets up some simple environment and run sh.
    it also talks about /etc/cron.d/cron.allow
    So it looks like those users need to be given a home directory
    like /tmp , but you need to think about the implication, are the accounts locked to stop logins
    truss -fpl $(pgrep cron)
    might show you what it is doing.
    it also talks about /etc/cron.d/cron.allow do you have such a file?
    tim

  • DBMS_SCHEDULER.RUN_JOB causes scheduled job not to run again

    Environment: 10.2.0.2 Linux 64-bit
    Hi,
    I have some DBMS_SCHEDULER chain jobs scheduled to run every hour which has been running fine with no issues for a while now.
    I needed to run a couple of jobs manually in-between scheduled times so I ran the job using DBMS_SCHEDULER.RUN_JOB, and that worked as expected as it has done in the past.
    This issue is that the jobs I ran manually haven't run at their scheduled time since I did that. The only way around it was to recreate the job completely.
    Any idea if this is normal functionality, or should I be raising this as a possible issue through Oracle Metalink?
    Any help or ideas would be much appreciated.
    Thanks
    Tim

    Hi Tim,
    This is a known bug which is tracked internally by bug #5705385. It will be fixed in the next patchsets for 10.2 and 11.1 (i.e. 10.2.0.5 and 11.1.0.7) . If you urgently need a fix, an official patch seems to be available for 10.2.0.3 .
    There does seem to be a workaround - using run_job again after the first run_job has completed will not do anything but the chain job should again run on schedule.
    Hope this helps,
    Ravi.

  • Oracle 10g form not always running in windows 7

    hello all of you experts , the query which I am going to post here is very annoying for me but it there might be a simple solution to my problem. I have installed oracle developer 10g on windows 7. Changed the formsweb.cfg file so that it uses java plug in rather than jinitiator I have installed the JRE version 6, now the problem is that when i try to run a form sometimes it runs properly but sometimes the browser window becomes blank and the form is not visible in it and yes the splash screen which shows the name of application server stays there on the screen. the problem is in internet explorer, mozilla and chrome as well didn't check on any other browser. Please help me out i would be grateful to you guys out there. Just to let you know that this annoying behavior is not always there, i dont know why some forms do run properly but some of them dont.

    That is actually not an uncommon symptom for any Windows platform. However, I will say that if you are running on Windows 7, it should be Win7-32bit and you should have installed the 10.1.2.3 patch set. Anything else would not be considered certified by Oracle and therefore not supported. The details on how to properly install Forms/Reports 10.1.2 on Win7 are outlined in MyOracleSupport note 1292919.1
    Assuming you covered all that, with Dev Suite this often happens when you have abandoned a process previously then tried to start another before the first has been terminated. In other words, next time you have this happen close ALL open browser windows then open the Windows task manager. Look for any orphaned frmweb.exe processes and kill them. Now go back and try starting a form. It should work now.
    It is never a good idea to terminate a running form by closing the browser. It is important that you close the form first (e.g. using the Exit button in the form) then close the browser. Closing the browser while a form is running can cause runtime processes to become orphaned. Generally these will be cleaned up when FORMS_TIMEOUT is reached (usually 15 minutes), but the point is that you have prevented a clean shutdown from occurring. So always make a best effort attempt at closing the form properly. End-users should be encouraged to do the same when the application is put into production.

  • Cron job : how to run scripts as cron job

    Hi friend,
    Sorry one very small question ..
    Can someone tell me how can i run scripts as cron job .. on HP UX.
    thanks
    ashish

    Hi Ashish,
    open one telnet session.
    crontab -e
    then give the periodicity day and time
    like below
    05 00 * * 1-6  /usr/local/bin/database_backup.sh
    and now create the script file with the command or script to execute.
    Regards
    Ashok Dalai

  • Cron jobs not running

    Hi
    I am using linux 5.x
    uname -r
    2.6.18-348.16.1.0.1.el5PAE
    I have 2 crontab jobs set up as following .
    cat backup_confluence.sh
    #!/bin/bash
    # bash shell script to backup confluence backups to bccpfr
    # Schedule this script after the backups are performed that day
    # Setup the environment for the bourne-again shell
    . ./.bash_profile
    # Copy the daily backups for confluence
    find /usr/share/confluence/data/backups -mtime -1 \! -type d -exec ls {} \; -exec scp {} bccpfr:/usr/backup/confluence \;
    second
    cat  backup_jira.sh
    #!/bin/bash
    # bash shell script to backup jira backups to bccpfr
    # Schedule this script after the backups are performed that day
    # Setup the environment for the bourne-again shell
    . ./.bash_profile
    # Copy the daily backups for jira
    find /usr/share/jira/backups -mtime -1 \! -type d -exec ls {} \; -exec scp {} bccpfr:/usr/backup/jira \;
    cron as following
    $ crontab -l
    13 06 * * * /home/lsg/backup_jira.sh
    18 06 * * * /home/lsg/backup_confluence.sh
    Issue
    Both the above .sh are running properly when executed  manually but they are not running automatically at the given time crontab job.
    Kindly help me on this issue.
    many thanks
    J

    Is your crontask not running at all or is the scheduled task failing?
    Hey Tommy I sent you some replies yesterday; don't know what happened to them. Yes I can see that crond runs every ten minutes. Also when I created the crontab file using the command you sent here I could see that it was running every minute by looking at root mail in /var/log.
    Do you have execute permission set on the scripts?
    Yes
    Any info in /var/log/messages or e-mail?
    Output from mail-
    From root@razorback  Tue Feb 11 08:19:01 2014
    Return-Path: <root@razorback>
    Received: from razorback (localhost [127.0.0.1])
        by razorback (8.13.8/8.13.8) with ESMTP id s1BEJ154018231
        for <root@razorback>; Tue, 11 Feb 2014 08:19:01 -0600
    Received: (from root@localhost)
        by razorback (8.13.8/8.13.8/Submit) id s1BEJ1rh018198;
        Tue, 11 Feb 2014 08:19:01 -0600
    Date: Tue, 11 Feb 2014 08:19:01 -0600
    Message-Id: <201402111419.s1BEJ1rh018198@razorback>
    From: root@razorback (Cron Daemon)
    To: root@razorback
    Subject: Cron <root@razorback> $(date) >> /tmp/cronout
    Content-Type: text/plain; charset=UTF-8
    Auto-Submitted: auto-generated
    X-Cron-Env: <SHELL=/bin/sh>
    X-Cron-Env: <HOME=/root>
    X-Cron-Env: <PATH=/usr/bin:/bin>
    X-Cron-Env: <LOGNAME=root>
    X-Cron-Env: <USER=root>
    /bin/sh: Tue: command not found
    From root@razorback  Tue Feb 11 08:20:02 2014
    Return-Path: <root@razorback>
    Received: from razorback (localhost [127.0.0.1])
        by razorback (8.13.8/8.13.8) with ESMTP id s1BEK2BD018267
        for <root@razorback>; Tue, 11 Feb 2014 08:20:02 -0600
    Received: (from root@localhost)
        by razorback (8.13.8/8.13.8/Submit) id s1BEK1mT018238;
        Tue, 11 Feb 2014 08:20:01 -0600
    Date: Tue, 11 Feb 2014 08:20:01 -0600
    Message-Id: <201402111420.s1BEK1mT018238@razorback>
    From: root@razorback (Cron Daemon)
    To: root@razorback
    Subject: Cron <root@razorback> $(date) >> /tmp/cronout
    Content-Type: text/plain; charset=UTF-8
    Auto-Submitted: auto-generated
    X-Cron-Env: <SHELL=/bin/sh>
    X-Cron-Env: <HOME=/root>
    X-Cron-Env: <PATH=/usr/bin:/bin>
    X-Cron-Env: <LOGNAME=root>
    X-Cron-Env: <USER=root>
    /bin/sh: Tue: command not found

  • Cisco LMS netconfig job not saving running config to startup

    Hi,
    I'm running LMS3.2 and RME 4.3.1. I deployed a netconfig job to our network which consisted of approximately 800 devices.
    The report said that the job completed successfully however some of the devices didn't save thier running config to startup. Has anyone experienced this before?
    Is it possible to add a command or issue another netconfig job just to save the running config, so I can identify if the job fails on some devices? Using the tick box in the netconfig job doesn't seem to alert you if its not successful.
    Thanks,

    I have seen in the past where someone is running a netconfig job with the cmd to "wr mem" as a line in the netconfig job. 
    Sven is correct, there is an option; radio button/check box to save the running config to startup after the job is completed.
    if your job is strictly meant to "wr mem/write the config" then run a show command in config mode (non-enable) mode and select the option to save running config after job is completed.

  • Why do Yahoo Flash videos not always run correctly in Chrome and Firefox/Windows 8?

    I upgraded early last month to Windows 8 Pro.
    Running Yahoo! News and other videos (Yahoo! Screen, etc.; virtually all Yahoo branded products) I get a black screen, no error message on Chrome and Firefox. The videos run correctly on Internet Explorer.
    I have not found a way to run these videos at all in Firefox or the 64-bit Waterfox.
    In Chrome, I can DISABLE the internal Pepper-based Flash player and the videos will run (but nothing ELSE will: no YouTube, etc.)
    I can keep a plug-ins page open in Chrome and repeatedly enable and disable the internal Flash player; I can copy and paste the URL for what I'm watching back into IE...or perhaps some kind and knowing person here will have a better idea. For me, I sense a bug somewhere. BTW...this machine dual-boots Win8 and WIn7. The problem does not exist in Win7. Please don't suggest going back to Win7; that's a VERY mature (translate SLOW and quirky; survived repeated change of motherboard and other major components) install that I'm continually weaning myself away from and rarely boot into it anymore (Win8 boots from SSD and is blazingly fast, Win7 not so much).
    I have not found any site other than the ENTIRE Yahoo site that has this problem!
    Jay from the Bronx

    I'm back! Actually, this issue has been happening to me every now & then but I'd just given up on dealing with it. But now I'm motivated again.
    I clicked on a video link in Facebook that sent me to NASCAR | Facebook which turns from the https URL to those two words on this site for some odd reason, and it just popped a box telling me saying Flash Player Upgrade Required - Get Flash Player and the video's image never displayed under that and it couldn't be played.
    Then once again I went thru all of the steps to insure that both I do actually have Flash Player and that it is Enabled. I do and it is. I also read somewhere to click the gear icon in IE then click Safety > ActiveX Filtering. I do that and I see a checkmark next to ActiveX Filtering. I've tried it both with a checkmark and without one and there's no difference.
    I have Windows 8.1 fully updated, IE-11 and Flash Player
    I see the swinging tire swing image in #5. Verify if Flash Player is installed at Flash Player Help.

  • Reg Cron Jobs

    hi,
    I need to run a cron job every alternate wednesdays...in a year
    Any suggestions????
    Thnx,
    Enz

    Method 1: Run a cron job every wednesday. Run your job if `date +%U` is even.
    problems: Some years will have 53 wednesdays, so eventually you'll run your job on consecutive weeks.
    Method 2: Run a cron job every wednesday. Set a file as a sentinel. If clear, set it and run your job. If set, clear it and dont' run the job.
    problems: If the cron job fails to run, your "alternate week" might get out of sync. Someone might screw up the sentinel file.
    Pick one based on your needs
    Darren

  • Is it possible to have a Cron job in CPO to check the running status of a workflow

    Is it possible to have a Cron job in CPO to check every hour to see if a particular workflow is running, if not trigger it by creating a alert, if yes- autokill

    Hi Warren,
    We don't want our process to expire and also not to execute twice at once. We have a provisioning wrapper workflow which is triggered one time by an alert and it runs endlessly by creating an alert at the end of each instance triggering another instance of the same unless CPO hangs or goes to stand by mode. Since we belong to service team, we don't have any kind of access to CPO DB or logs, so that possibility is ruled out. Just checking for alternatives. 

  • Cron job help- Need to run the Autobuddy command every night...

    I have not written anything in the form of a Unix script for YEARS and YEARS. Our XServe was built in Advanced mode, currently running 10.5.4 Server. On this box, we are running Wiki and iChat. Since we built this box as an Advanced box the "Autobuddy" option was not available.
    I have since enabled it at the command line, but I am told by Apple that there still needs to be a command run after every time a user logs in if you want others to Autobuddy. That command is this:
    "sudo /usr/bin/jabber_autobuddy -m"
    Now I think this would be pretty easy to setup as an automatic cron script, but like I said, I have not written something like this in forever. Not to mention, I am not 100% sure what needs to happen since running the script with an sudo command will prompt for the root password.
    I was wondering if anyone would be able to help me write the script up, and give me some instructions on how to install it. I just want it run everyday, midnight is fine, I don't really care. All I know is that we have a dept of 150 people, and it grows and shrinks all the time. They can deal with a new user not being seen for 24-48 hours, I just want to get this automated.
    Any helps would be GREATLY appreciated!
    Thanks
    Tom

    If you want to keep it simple try [CronniX|http://www.abstracture.de/projects-en/cronnix] a graphical tool for setting up CRON jobs on OSX. Whilst I have not actually done an autobuuddy in this way, I cannot see any reason why it will not run as a Cron Job.
    The proper way ideally would be to use the launchd service.
    Something like this should work:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.jabber.dailyautobuddy</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/bin/jabber_autobuddy</string>
    <string>-m</string>
    </array>
    <key>LowPriorityIO</key>
    <true/>
    <key><UserName></key>
    <string>admin</string>
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>0</integer>
    <key>Minute</key>
    <integer>05</integer>
    </dict>
    </dict>
    </plist>
    (not sure why, but tabs are not showing up, making this hard to read)
    Message was edited by: Tim Harris

  • Need advice on running timer based cron jobs

    Hi,
    We made a cool desktop product on Flex that runs on the Air environment. After having released it a while ago, we think about taking its performance to the next level by being able to mimic cron job like functionality based on timers.
    However, one of the setbacks for us while we tried to do something similar earlier was the Flash platform's single threaded architecture. So if we are running something resource consuming in the background, chances are that the UI might get stuck if a part of it is being rendered. That will make things looks ugly and we are trying to find ways to make it work.
    Can anyone recommend anything that would help?
    Thanks!
    Vivek

    > 1. What is the best fastest system AE can take advantage of? If we get 6 or 8 or 12 core Mac Pros (instead of the quad core) with more RAM, would AE be able to access that speed, and if so up to how many GB can it use, only up to 2GB per core or can it use more?
    Yes, After Effects will take advantage of multiple fast CPUs and all of the RAM that you can install.
    You also want to have a decent-sized SSD connected over a fast bus for the disk cache. The new Mac Pro does very well in that regard.
    2. Should we replace the graphics card with an Nvidia CUDA? Is the ray-tracing engine something we’ll need with Cinema 4D work?
    The After Effects ray-traced 3D renderer has nothing whatsoever to do with Cinema 4D.
    Do not make any buying decisions based on the  After Effects ray-traced 3D renderer unless you already know for certain that you have a need for it. Since you're asking, it seems that the answer is that you don't.
    See this page for information about hardware for Premiere Pro and After Effects: http://adobe.ly/pRYOuk

  • DBA scripts run by cron job

    We've got a development database on which we're working every day. We intend to set up a cron job to run about once a week to help in the maintainance & performance of the database.... analyzing tables, stuff like that. Does anybody have any suggestions as to what scripts it's useful to run to help keep things running smoothly?
    We're using 9.0.1
    Cheers
    RT

    We've got a development database on which we're working every day. We intend to set up a cron job to run about once a week to help in the maintainance & performance of the database.... analyzing tables, stuff like that. Does anybody have any suggestions as to what scripts it's useful to run to help keep things running smoothly?
    We're using 9.0.1
    Cheers
    RT i'd suggest you try out oracle enterprise manager and look at the list of events you can test for. You can use this list to implement in cron or let OEM do it for you. You'll find test like, is the listener up, is the db up, is the server up, what tablespaces will not be able to extend, if a disk is getting fulletc and stuff like that . Those items should help you frame your scripts for cron if you like.

Maybe you are looking for