packages: ocs-inventory-ng-client/ocs-inventory-ng-client.cron - daily cron
wolvverine
wolvverine at pld-linux.org
Fri Oct 9 17:19:37 CEST 2009
Author: wolvverine Date: Fri Oct 9 15:19:37 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- daily cron
---- Files affected:
packages/ocs-inventory-ng-client:
ocs-inventory-ng-client.cron (1.1 -> 1.2)
---- Diffs:
================================================================
Index: packages/ocs-inventory-ng-client/ocs-inventory-ng-client.cron
diff -u packages/ocs-inventory-ng-client/ocs-inventory-ng-client.cron:1.1 packages/ocs-inventory-ng-client/ocs-inventory-ng-client.cron:1.2
--- packages/ocs-inventory-ng-client/ocs-inventory-ng-client.cron:1.1 Sun Mar 2 04:45:06 2008
+++ packages/ocs-inventory-ng-client/ocs-inventory-ng-client.cron Fri Oct 9 17:19:31 2009
@@ -1 +1,36 @@
-1 12 * * * root cd /usr/sbin && perl ocsinventory-client.pl > /dev/null 2>&1
+#!/bin/bash
+NAME=ocsinventory-agent
+
+exec >>/var/log/$NAME/$NAME.log 2>&1
+
+[ -f /etc/sysconfig/$NAME ] || exit 0
+source /etc/sysconfig/$NAME
+export PATH
+
+i=0
+while [ $i -lt ${#OCSMODE[*]} ]
+do
+ if [ ${OCSMODE[$i]:-none} == cron ]; then
+ OPTS=
+ if [ ! -z "${OCSPAUSE[$i]}" ]; then
+ OPTS="--wait ${OCSPAUSE[$i]}"
+ fi
+
+ if [ ! -z "${OCSTAG[$i]}" ]; then
+ OPTS="$OPTS --tag=${OCSTAG[$i]}"
+ fi
+
+ if [ "z${OCSSERVER[$i]}" = 'zlocal' ]; then
+ # Local inventory
+ OPTS="$OPTS --local=/var/lib/$NAME"
+ elif [ ! -z "${OCSSERVER[$i]}" ]; then
+ # Remote inventory
+ OPTS="$OPTS --lazy --server=${OCSSERVER[$i]}"
+ fi
+ echo "[$(date '+%c')] Running $NAME $OPTS"
+ /usr/bin/$NAME $OPTS
+ fi
+ ((i++))
+done
+echo "[$(date '+%c')] End of cron job ($PATH)"
+
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/ocs-inventory-ng-client/ocs-inventory-ng-client.cron?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list