Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 251313

Issue with a crond

$
0
0

Hi all!

 

I have some problems with a sheduled tasks for crond.

 

There is a test script backup_script.sh , that I'm trying to strat in ESXi:

 

#!/bin/sh
PID_LOG=/vmfs/volumes/datastore1/rsync/pidlog.log
echo "$(date +%F" "%T) PID:$ STARTED" >> $PID_LOG
ps -c -g | grep backup_* >> $PID_LOG

 

Also, there is a job in /var/spool/cron/crontabs/root:

 

#min hour day mon dow command

1    1    *   *   *   /sbin/tmpwatch.py

1    *    *   *   *   /sbin/auto-backup.sh

0    *    *   *   *   /usr/lib/vmware/vmksummary/log-heartbeat.py

0    0    *   *   *   /vmfs/volumes/datastore1/ghettoVCB/ghettoVCB.sh -f /vmfs/volumes/datastore1/ghettoVCB/vm_list -g /vmfs/volumes/datastore1/ghettoVCB/ghettoVCB.conf -l /vmfs/volumes/datastore1/ghettoVCB/log > /dev/null

0    3    *   *   *   /vmfs/volumes/datastore1/rsync/backup_script.sh > /dev/null

 

So, as I understand, crond has to start my script every day, but only once in 3:00

But I've got another results - there is an output of pidlog.log:

 

2013-02-13 03:00:01 PID:11263374 STARTED

11246988 11246988 sh                  3324 3324  /bin/sh -c /vmfs/volumes/datastore1/rsync/backup_script.sh > /dev/null

11263374 11263374 sh                  3324 3324  /bin/sh /vmfs/volumes/datastore1/rsync/backup_script.sh

11222417 11222417 grep                3324 3324  grep backup_*

2013-02-13 03:00:01 PID:11292068 STARTED

11246988 11246988 sh                  3324 3324  /bin/sh -c /vmfs/volumes/datastore1/rsync/backup_script.sh > /dev/null

11263374 11263374 sh                  3324 3324  /bin/sh /vmfs/volumes/datastore1/rsync/backup_script.sh

11292066 11292066 sh                  11279503 11279503  /bin/sh -c /vmfs/volumes/datastore1/rsync/backup_script.sh > /dev/null

11292068 11292068 sh                  11279503 11279503  /bin/sh /vmfs/volumes/datastore1/rsync/backup_script.sh

11296178 11296178 grep                11279503 11279503  grep backup_*

 

As you can see my script is started twice. First time it was started by a process with PID 3324 wich is busybox:

~ # ps -P | grep 3324

3324 3324 busybox              2163 /bin/busybox

 

Secind time it was started by a process with PID 11279503  wich is crond:

~ # ps -P | grep 11279503

11279503 11279503 crond        2163 /bin/crond

 

I can't understand, why does it work this way?

Any ideas?

 

Thanks.


Viewing all articles
Browse latest Browse all 251313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>