duplicate jobs running from single cron entry - SUN

This is a discussion on duplicate jobs running from single cron entry - SUN ; I have a cron entry: 20 05 * * * $HOME/cron/refresh_SRPT80_cp.sh >>$HOME/cron/ refresh_SRPT80.log 2>&1 When this starts up I see two entries for it in the ps table: oracle 17843 309 0 05:20:00 ? 0:00 sh -c $HOME/cron/ refresh_SRPT80_cp.sh >>$HOME/cron/refresh_SRPT80.log ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: duplicate jobs running from single cron entry

  1. duplicate jobs running from single cron entry

    I have a cron entry:

    20 05 * * * $HOME/cron/refresh_SRPT80_cp.sh >>$HOME/cron/
    refresh_SRPT80.log 2>&1

    When this starts up I see two entries for it in the ps table:

    oracle 17843 309 0 05:20:00 ? 0:00 sh -c $HOME/cron/
    refresh_SRPT80_cp.sh >>$HOME/cron/refresh_SRPT80.log 2>&1

    oracle 17846 17843 0 05:20:00 ? 0:00 sh -c $HOME/cron/
    refresh_SRPT80_cp.sh >>$HOME/cron/refresh_SRPT80.log 2>&1

    You can see that the first one has a PPID of 309 which is cron:

    root 309 1 0 Oct 27 ? 0:02 /usr/sbin/cron

    the second one has a PPID of the first one. Does anybody have any
    idea how this could be happening?

    Thanks!
    Andy



    Here's the script:

    # 09-15-2003
    # refresh SRPT80 nitely
    #

    cd /opt/oracle/admin/srpt80/refresh
    pwd
    ../refresh_SA_db_expimp_cp.sh SRPT80

    exit 0


  2. Re: duplicate jobs running from single cron entry

    Hi,


    This might be normal depending on what you have on your script. Let me
    show this with an example:

    tomescu@tomescu-desktop:~/work$ cat 1.sh
    #!/bin/sh
    /bin/sleep 600

    After running 1.sh ps -ef shows:

    tomescu 21909 20489 0 20:08 pts/1 00:00:00 sh -c ./1.sh
    tomescu 21910 21909 0 20:08 pts/1 00:00:00 /bin/sh ./1.sh


    In your case the cron runs the command with sh -c which makes it appear
    twice. It will appear once if you invoke exec.


    Best regards,
    Catalin

    Andy wrote:
    > I have a cron entry:
    >
    > 20 05 * * * $HOME/cron/refresh_SRPT80_cp.sh >>$HOME/cron/
    > refresh_SRPT80.log 2>&1
    >
    > When this starts up I see two entries for it in the ps table:
    >
    > oracle 17843 309 0 05:20:00 ? 0:00 sh -c $HOME/cron/
    > refresh_SRPT80_cp.sh >>$HOME/cron/refresh_SRPT80.log 2>&1
    >
    > oracle 17846 17843 0 05:20:00 ? 0:00 sh -c $HOME/cron/
    > refresh_SRPT80_cp.sh >>$HOME/cron/refresh_SRPT80.log 2>&1
    >
    > You can see that the first one has a PPID of 309 which is cron:
    >
    > root 309 1 0 Oct 27 ? 0:02 /usr/sbin/cron
    >
    > the second one has a PPID of the first one. Does anybody have any
    > idea how this could be happening?
    >
    > Thanks!
    > Andy
    >
    >
    >
    > Here's the script:
    >
    > # 09-15-2003
    > # refresh SRPT80 nitely
    > #
    >
    > cd /opt/oracle/admin/srpt80/refresh
    > pwd
    > ./refresh_SA_db_expimp_cp.sh SRPT80
    >
    > exit 0
    >


+ Reply to Thread