Hello all!
I've written a patch to Cron.sh to actually allow using the OTRS_USER
option. Additionally, enumerating the available cron jobs gets improved.
The patch is attached and available under:
http://wiki.robertkehl.de/index.pl?PatchImproveOtrsCron
With kind regards,
Robert Kehl
--- bin/Cron.sh
+++ bin/Cron.sh
@@ -21,17 +21,19 @@
# --
CURRENTUSER=`whoami`
-OTRS_HOME=$HOME
-#CRON_USER=" -u $RUNASUSER ";
-CRON_USER=""
-if test $CURRENTUSER = root; then
+if test "$CURRENTUSER" == 'root'; then
+ if test "$2" == ""; then
echo "Run this script just as OTRS user! Or use 'Cron.sh {start|stop|restart} OTRS_USER'!"
exit 5
+ else
+ su - $2 -c $0 $1
+ exit
+ fi
fi
# find otrs root
-#OTRS_ROOT=/opt/OpenTRS
+OTRS_HOME=`getent passwd $CURRENTUSER | awk -F: '{ print $6 }'`
if test -e $OTRS_HOME/var/cron; then
OTRS_ROOT=$OTRS_HOME
else
@@ -54,7 +56,7 @@
# start
# ------------------------------------------------------
start)
- if mkdir -p $CRON_DIR; cd $CRON_DIR && ls * |grep -v '.dist'|grep -v '.rpm'| grep -v CVS | grep -v Entries | grep -v Repository | grep -v Root | xargs cat > $CRON_TMP_FILE && crontab $CRON_USER $CRON_TMP_FILE; then
+ if mkdir -p $CRON_DIR && find $CRON_DIR ! -name *.dist ! -name *.rpm ! -path "*/CVS/*" -type f | xargs cat > $CRON_TMP_FILE && crontab $CRON_TMP_FILE; then
rm -rf $CRON_TMP_FILE
echo "(using $OTRS_ROOT) done";
exit 0;
At 10/27/04 11:02 PM, Martin Edenhofer wrote:
>o PostgreSQL with smallints and bigints changes to ints: Currently we
>write a tool to generate MySQL, PostgreSQL, SAPDB, Oracle, ... output
>based from XML. This is nearly finished. We hate to maintain different
>.sql files for different sql databases. So if this is ready, we just
>generate for postgresql performance improved create scripts (not
>smallints, no bigints).
That sounds great. Please post to the dev list when this is ready and I
will test the generated PostgreSQL schema to be sure it is working as
fast as possible.
Thanks again!
--
Robert L Mathews, Tiger Technologies http://www.tigertech.net/
"Ignorance more frequently begets confidence than does knowledge."
-- Darwin