Cron Job wird nicht ausgeführt

Hilfe zu Znuny Problemen aller Art
Locked
kiwi
Znuny newbie
Posts: 23
Joined: 13 Apr 2012, 14:39
Znuny Version: 4.0.6
Real Name: Oswin Gilgert

Cron Job wird nicht ausgeführt

Post by kiwi »

Hallo,

Nachdem ich nun diverse Forumseinträge durchgelesen, aber keine (für mich) nachvollziehbare Lösung gefunden habe, hoffe ich, dass mir Jemand aus dem Forum weiterhelfen kann.

Die Mails werden direkt von IMAP Konten ohne fetchmail abgeholt (manuelle Abholung funktioniert tadellos).
Ich habe die Cronjobs wie im Handbuch angegeben im Verzeichnis /opt/otrs/var/cron installiert.
Alle Scripte (ohne Endung) sind im Verzeichnis /opt/otrs/var/cron vorhanden.
Der Cron-Job liegt im Verzeichnis /opt/otrs/bin.
Der Eigentümer des Jobs ist der User otrs, die Gruppe ist www-data.
Das Script PostMasterMailbox.pl ist korrekt eingerichtet (Abholung alle 2 Minuten) und befindet sich im Verzeichnis /opt/otrs/bin.
Beim Aufruf des Scripts ./otrs.PostMastermailbox.pl (unter "su otrs") im Verzeichnis /opt/otrs/bin werden alle Mails auch korrekt abgerufen.
Beim Aufruf des Scripts /opt/otrs/bin/ ./Cron.sh start otrs oder ./Cron.sh restart otrs wird das Script ohne Fehler ausgeführt.
Das automatische Abholen der Mails jedoch findet nicht statt.

Wo liegt hier der Fehler??
siduction-Indian summer 2014.11.13, apache 2.4-10, MySQL 5.5.42-1, otrs 4.06
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron Job wird nicht ausgeführt

Post by jojo »

was gibt crontab -l -u otrs aus?
was das Logfile?
"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
kiwi
Znuny newbie
Posts: 23
Joined: 13 Apr 2012, 14:39
Znuny Version: 4.0.6
Real Name: Oswin Gilgert

Re: Cron Job wird nicht ausgeführt

Post by kiwi »

Folgendes gibt crontab -l -u otrs aus:

# --
# cron/aaa_base - base crontab package
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: aaa_base.dist,v 1.7 2009/02/16 20:35:25 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# Who gets the cron emails?
MAILTO="root@localhost"
# --
# cron/cache - delete expired cache
# Copyright (C) 2001-2010 xxx, http://otrs.org/
# --
# $Id: cache.dist,v 1.2 2010/11/22 12:15:35 mg Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# delete expired cache weekly (Sunday mornings)
20 0 * * 0 $HOME/bin/otrs.DeleteCache.pl --expired >> /dev/null
30 0 * * 0 $HOME/bin/otrs.LoaderCache.pl -o delete >> /dev/null
# --
# cron/fetchmail - fetchmail cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: fetchmail.dist,v 1.10 2009/02/16 20:53:10 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# fetch every 5 minutes emails via fetchmail
#*/2 * * * * [ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null
#*/5 * * * * /usr/bin/fetchmail -a --ssl >> /dev/null
# --
# cron/fetchmail - fetchmail cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: fetchmail.dist,v 1.10 2009/02/16 20:53:10 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# fetch every 5 minutes emails via fetchmail
#*/5 * * * * [ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null
#*/5 * * * * /usr/bin/fetchmail -a --ssl >> /dev/null
# --
# cron/generic_agent - otrs.GenericAgent.pl cron of the OTRS
# Copyright (C) 2001-2012 xxx, http://otrs.org/
# --
# $Id: generic_agent.dist,v 1.15 2012/02/07 20:11:16 jb Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# start generic agent every 20 minutes
*/20 * * * * $HOME/bin/otrs.GenericAgent.pl >> /dev/null

# example to execute otrs.GenericAgent.pl on 23:00 with
# Kernel::Config::GenericAgentMove job file
#0 23 * * * $HOME/bin/otrs.GenericAgent.pl -c "Kernel::Config::GenericAgentMove" >> /dev/null
# --
# cron/generic_agent - otrs.GenericAgent.pl cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: generic_agent-database.dist,v 1.9 2009/11/04 12:27:57 mn Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# start generic agent every 10 minutes
*/10 * * * * $HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null
# --
# cron/itsmchange_check - itsm change check cron of the OTRS
# Copyright (C) 2003-2010 xxx, http://otrs.com/
# --
# $Id: itsmchange_check.dist,v 1.1 2010/01/26 15:55:31 reb Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# check every 120 min the changes
45 */2 * * * $HOME/bin/otrs.ITSMChangesCheck.pl >> /dev/null
# --
# cron/pending_jobs - pending_jobs cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: pending_jobs.dist,v 1.12 2009/11/04 12:27:57 mn Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# check every 120 min the pending jobs
45 */2 * * * $HOME/bin/otrs.PendingJobs.pl >> /dev/null
# --
# cron/postmaster - postmaster cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: postmaster.dist,v 1.9 2009/02/16 20:55:11 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# check daily the spool directory of OTRS
#10 0 * * * * [ -e /etc/init.d/otrs ] && /etc/init.d/otrs cleanup >> /dev/null; [ -e /etc/rc.d/init.d/otrs ] && /etc/rc.d/init.d/otrs cleanup >> /dev/null
10 0 * * * $HOME/bin/otrs.cleanup >> /dev/null
# --
# cron/postmaster_mailbox - postmaster_mailbox cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: postmaster_mailbox.dist,v 1.3 2009/11/09 15:24:13 mn Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# fetch emails every 10 minutes
*/2 * * * * $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
# --
# cron/postmaster_mailbox - postmaster_mailbox cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: postmaster_mailbox.dist,v 1.3 2009/11/09 15:24:13 mn Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# fetch emails every 10 minutes
*/5 * * * * $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
# --
# cron/rebuild_ticket_index - rebuild ticket index for OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: rebuild_ticket_index.dist,v 1.10 2009/11/09 15:24:13 mn Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# just every day
01 01 * * * $HOME/bin/otrs.RebuildTicketIndex.pl >> /dev/null
# --
# cron/session - delete old session ids of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: session.dist,v 1.12 2009/11/04 12:27:57 mn Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# delete every 120 minutes old/idle session ids
55 */2 * * * $HOME/bin/otrs.DeleteSessionIDs.pl --expired >> /dev/null
# --
# cron/survey_trigger_send_requests - send delayed survey requests
# Copyright (C) 2001-2011 xxx, http://otrs.org/
# --
# $Id: survey_trigger_send_requests.dist,v 1.2 2011/12/15 16:30:11 jh Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see L<http://www.gnu.org/licenses/agpl.txt>.
# --

# This file is distributed with the extenstion '.dist'.
# Please remove the extension and uncomment the last line for production.

# every 20 min
#*/20 * * * * $HOME/bin/otrs.SurveyTriggerSendRequests.pl -e >> /dev/null# --
# cron/unlock - unlock old locked ticket of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: unlock.dist,v 1.11 2009/11/04 12:27:57 mn Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# unlock every hour old locked tickets
35 * * * * $HOME/bin/otrs.UnlockTickets.pl --timeout >> /dev/null

Wo kann ich das Logfile finden?

Danke im voraus
siduction-Indian summer 2014.11.13, apache 2.4-10, MySQL 5.5.42-1, otrs 4.06
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron Job wird nicht ausgeführt

Post by jojo »

wahrscheinlich unter /var/log
"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
kiwi
Znuny newbie
Posts: 23
Joined: 13 Apr 2012, 14:39
Znuny Version: 4.0.6
Real Name: Oswin Gilgert

Re: Cron Job wird nicht ausgeführt

Post by kiwi »

zu dem Cron-Job finde ich keine log.
Die Syslog im Verzeichnis /var/Log zeigt folgendes:

Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19013]: (otrs) CMD (test -x $HOME/bin/otrs.GenericAgent.pl && $HOME/bin/otrs.GenericAgent.pl -c db > /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19014]: (otrs) CMD ($HOME/bin/otrs.PostMasterMailbox.pl > /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19003]: (CRON) info (No MTA installed, discarding output)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19016]: (otrs) CMD ([ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19017]: (root) CMD ([ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19018]: (root) CMD ($HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19006]: (CRON) info (No MTA installed, discarding output)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19019]: (otrs) CMD ($HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19020]: (otrs) CMD ($HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19010]: (CRON) info (No MTA installed, discarding output)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19023]: (root) CMD ($HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19009]: (CRON) info (No MTA installed, discarding output)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19005]: (CRON) info (No MTA installed, discarding output)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19026]: (root) CMD ($HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19027]: (otrs) CMD ($HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19007]: (CRON) info (No MTA installed, discarding output)
Oct 9 13:10:01 OTRS-Server /USR/SBIN/CRON[19011]: (CRON) info (No MTA installed, discarding output)
Oct 9 13:12:01 OTRS-Server /USR/SBIN/CRON[19517]: (root) CMD ([ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null)
Oct 9 13:12:01 OTRS-Server /USR/SBIN/CRON[19518]: (otrs) CMD ([ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null)
Oct 9 13:12:01 OTRS-Server /USR/SBIN/CRON[19519]: (root) CMD ($HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null)
Oct 9 13:12:01 OTRS-Server /USR/SBIN/CRON[19513]: (CRON) info (No MTA installed, discarding output)
Oct 9 13:12:01 OTRS-Server /USR/SBIN/CRON[19521]: (otrs) CMD ($HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null)
Oct 9 13:12:01 OTRS-Server /USR/SBIN/CRON[19515]: (CRON) info (No MTA installed, discarding output)
siduction-Indian summer 2014.11.13, apache 2.4-10, MySQL 5.5.42-1, otrs 4.06
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron Job wird nicht ausgeführt

Post by jojo »

Oct 9 13:12:01 OTRS-Server /USR/SBIN/CRON[19521]: (otrs) CMD ($HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null)
Oct 9 13:12:01 OTRS-Server /USR/SBIN/CRON[19515]: (CRON) info (No MTA installed, discarding output)


er ist gelaufen und wollte irgendetwas (Fehler/Output) versenden. Mangels MTA durfte er das aber nicht
"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
kiwi
Znuny newbie
Posts: 23
Joined: 13 Apr 2012, 14:39
Znuny Version: 4.0.6
Real Name: Oswin Gilgert

Re: Cron Job wird nicht ausgeführt

Post by kiwi »

Was sagt mir das nun?
Wie gehe ich vor um dieses Problem in den Griff zu bekommen?
siduction-Indian summer 2014.11.13, apache 2.4-10, MySQL 5.5.42-1, otrs 4.06
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron Job wird nicht ausgeführt

Post by jojo »

zuerst sollte Dein Linux Admin das System mal so aufsetzen das es die Cron Mails verschicken kann..

Was für eine Ausgabe bekommst Du wenn Du das Script als OTRS user startest?
"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
kiwi
Znuny newbie
Posts: 23
Joined: 13 Apr 2012, 14:39
Znuny Version: 4.0.6
Real Name: Oswin Gilgert

Re: Cron Job wird nicht ausgeführt

Post by kiwi »

1) der Linux Admin bin ich selbst (habe mir alles bisher selber beigebracht, auch wenn ich noch viel zu lernen habe)
Was ist falsch an der Mailadresse root@localhost?

2) Wenn ich den Corn-job als otrs user laufen lasse bringt er die gleiche Meldung wie wenn ich das Script als root ausführe
./Cron.sh start otrs
/opt/otrs/bin
Cron.sh - start/stop OTRS cronjobs - <$Revision: 1.19 $>
Copyright (C) 2001-2009 xxx, http://otrs.org/
(using /opt/otrs) done
siduction-Indian summer 2014.11.13, apache 2.4-10, MySQL 5.5.42-1, otrs 4.06
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron Job wird nicht ausgeführt

Post by jojo »

das ist nicht der Cronjob an sich, das ist das Programm um die Crontab neu zu bauen.

Dein System hat keinen Mailserver installiert.
"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
kiwi
Znuny newbie
Posts: 23
Joined: 13 Apr 2012, 14:39
Znuny Version: 4.0.6
Real Name: Oswin Gilgert

Re: Cron Job wird nicht ausgeführt

Post by kiwi »

War leider heute morgen in einer etwas länger dauernden Besprechung.
das ist nicht der Cronjob an sich, das ist das Programm um die Crontab neu zu bauen
.
Was ist dann gemeint? (bin leider noch ein Laie bei solchen Problemen)
Dein System hat keinen Mailserver installiert.
Da muss ich mich erst mal in Foren schlau machen wie und welchen MTA in da installieren muss(sollte).
Hat jemand dafür eine Empfehlung (siduction ist ein auf Debian basierendes System)?
siduction-Indian summer 2014.11.13, apache 2.4-10, MySQL 5.5.42-1, otrs 4.06
Locked