How to change CRON ?

Moderator: crythias

Locked
waelkd
Znuny newbie
Posts: 62
Joined: 18 May 2012, 11:53
Znuny Version: 3.1.5

How to change CRON ?

Post by waelkd »

I have otrs set on windows server.

and i wish to minimize the fetch mail from 10 mins to 1 .

any idea how i can do this?

thanks
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: How to change CRON ?

Post by Wolfgangf »

change the crontab files and reload
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
waelkd
Znuny newbie
Posts: 62
Joined: 18 May 2012, 11:53
Znuny Version: 3.1.5

Re: How to change CRON ?

Post by waelkd »

Wolfgangf wrote:change the crontab files and reload

where are they located?

otrs/straweberryperl/bin? if so whats exact name of file
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to change CRON ?

Post by crythias »

otrs/var/cron/* <-- files

otrs/bin/Cron.sh restart otrs
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
waelkd
Znuny newbie
Posts: 62
Joined: 18 May 2012, 11:53
Znuny Version: 3.1.5

Re: How to change CRON ?

Post by waelkd »

crythias wrote:otrs/var/cron/* <-- files

otrs/bin/Cron.sh restart otrs

cant find where to decrease crown setting in cron.sh file

heres file info: where do i make the modifications?





#!/bin/sh
# --
# Cron.sh - start|stop OTRS Cronjobs
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: Cron.sh,v 1.19 2009/02/26 11:01:01 tr Exp $
# --
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU AFFERO General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# or see http://www.gnu.org/licenses/agpl.txt.
# --

CURRENTUSER=`whoami`
CRON_USER="$2"

# check if a common user try to use -u
if test -n "$CRON_USER"; then
if test $CURRENTUSER != root; then
echo "Run this script just as OTRS user! Or use 'Cron.sh {start|stop|restart} OTRS_USER' as root!"
exit 5
fi
fi

# check if the cron user is specified
if test -z "$CRON_USER"; then
if test $CURRENTUSER = root; then
echo "Run this script just as OTRS user! Or use 'Cron.sh {start|stop|restart} OTRS_USER' as root!"
exit 5
fi
fi

# find otrs root
cd "`dirname $0`/../"
OTRS_HOME="`pwd`"
cd -

#OTRS_ROOT=/opt/OpenTRS
if test -e $OTRS_HOME/var/cron; then
OTRS_ROOT=$OTRS_HOME
else
echo "No cronjobs in $OTRS_HOME/var/cron found!";
echo " * Check the \$HOME (/etc/passwd) of the OTRS user. It must be the root dir of your OTRS system (e. g. /opt/otrs). ";
exit 5;
fi

CRON_DIR=$OTRS_ROOT/var/cron
CRON_TMP_FILE=$OTRS_ROOT/var/tmp/otrs-cron-tmp.$$

echo "Cron.sh - start/stop OTRS cronjobs - <\$Revision: 1.19 $> "
echo "Copyright (C) 2001-2009 xxx, http://otrs.org/"

#
# main part
#
case "$1" in
# ------------------------------------------------------
# start
# ------------------------------------------------------
start)
# add -u to cron user if exits
if test -n "$CRON_USER"; then
CRON_USER=" -u $CRON_USER"
fi

if mkdir -p $CRON_DIR; cd $CRON_DIR && ls -d * | grep -v '.dist'| grep -v '.rpm'| grep -v CVS | xargs cat > $CRON_TMP_FILE && crontab $CRON_USER $CRON_TMP_FILE; then

rm -rf $CRON_TMP_FILE
echo "(using $OTRS_ROOT) done";
exit 0;
else
echo "failed";
exit 1;
fi
;;
# ------------------------------------------------------
# stop
# ------------------------------------------------------
stop)
# add -u to cron user if exits
if test -n "$CRON_USER"; then
CRON_USER=" -u $CRON_USER"
fi

if crontab $CRON_USER -r ; then
echo "done";
exit 0;
else
echo "failed";
exit 1;
fi
;;
# ------------------------------------------------------
# restart
# ------------------------------------------------------
restart)
$0 stop "$CRON_USER"
$0 start "$CRON_USER"
;;
# ------------------------------------------------------
# Usage
# ------------------------------------------------------
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: How to change CRON ?

Post by jojo »

Hi waelkd,

please don't ask the same question in more than one thread.

As already written in the other thread, edit the file postmaster_mailbox (or postmaster_mailbox.dist on Windows) an rebuild the cron tab.

You can do this with the Cron4win.pl script or use the scripts for restarting OTRS on windows
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
waelkd
Znuny newbie
Posts: 62
Joined: 18 May 2012, 11:53
Znuny Version: 3.1.5

Re: How to change CRON ?

Post by waelkd »

jojo wrote:Hi waelkd,

please don't ask the same question in more than one thread.

As already written in the other thread, edit the file postmaster_mailbox (or postmaster_mailbox.dist on Windows) an rebuild the cron tab.

You can do this with the Cron4win.pl script or use the scripts for restarting OTRS on windows

my bad, srry


anyways am in file postmater_mailbox , any idea where should i do the modifications.

what lines, what variable should i change.

thanks
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: How to change CRON ?

Post by jojo »

in var/cron/postmaster_mailbox there is just one line which is not commented out


Have also a look on http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
waelkd
Znuny newbie
Posts: 62
Joined: 18 May 2012, 11:53
Znuny Version: 3.1.5

Re: How to change CRON ?

Post by waelkd »

jojo wrote:in var/cron/postmaster_mailbox there is just one line which is not commented out


Have also a look on http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5


otrs.post mastermailbox.pl isnt found in cron, its in

c:\program files <x86>\otrs\otrs\bin


anyhow i found the file

but theres no single fetch timer on it.



Edit: you want me to post the file code here?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: How to change CRON ?

Post by jojo »

the file is named var/cron/postmaster_mailbox or var/cron/postmaster_mailbox.dist
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
waelkd
Znuny newbie
Posts: 62
Joined: 18 May 2012, 11:53
Znuny Version: 3.1.5

Re: How to change CRON ?

Post by waelkd »

jojo wrote:the file is named var/cron/postmaster_mailbox or var/cron/postmaster_mailbox.dist

Found it !!


the proper sytanx is /1? <--- as i wanted to refresh every 1 min

right?


And thanks again
Locked