Cron jobs not working

Moderator: crythias

Post Reply
naru
Znuny newbie
Posts: 9
Joined: 27 Aug 2019, 15:16
Znuny Version: 6.0.12

Cron jobs not working

Post by naru »

Hi all,

I have configured cron job for daily reports but it is not executing.

Regards,
naru
wurzel
Znuny guru
Posts: 3224
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: Cron jobs not working

Post by wurzel »

Hi,

... then you did not configure the cronjobs.
or you did it wrong.

Let's see them.

Flo
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
naru
Znuny newbie
Posts: 9
Joined: 27 Aug 2019, 15:16
Znuny Version: 6.0.12

Re: Cron jobs not working

Post by naru »

Hi,

Configured cron job as below.

#crontab -e -u otrs

* * * * * $HOME/bin/otrs.GenerateStats.pl -n 10001 -f CSV -r username@domain.com -m "Immediate List" -F ImmediateList

correct me if configured wrongly. cron job are executing in system side but working for otrs.

Note: i have changed email id value.

Thanks,
Naru
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron jobs not working

Post by jojo »

Please Check Home Directory and shell entry for the OTRS user. Also Running reports every Minute is not a good idea
"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
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron jobs not working

Post by jojo »

What Version of OTRS are you using? The command does not fit all versions
"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
naru
Znuny newbie
Posts: 9
Joined: 27 Aug 2019, 15:16
Znuny Version: 6.0.12

Re: Cron jobs not working

Post by naru »

I made every minute for immediate response. I'm using v6.0.12
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron jobs not working

Post by jojo »

Statistics should not be run every minute due to performance. Also the command is wrong. It seems that you did not try a manual run before. The stats are created by the Console command of OTRS.

Please also do an upgrade of your system as you have several Security bugs in your version.

As it seems that you have not the proper Know-how for operating Linux servers I suggest to contact a service Provider for the ((OTRS)) community edition or switch to a fully managed solution
"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
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Cron jobs not working

Post by zzz »

Hello naru,

Before you order a managed system (not quite sure how that will solve your problem) you can try this setting in the OTRS GUI.

Search the system configuration for 'Daemon::SchedulerCronTaskManager::Task' and select a disabled custom setting, like Daemon::SchedulerCronTaskManager::Task###Custom1.

Code: Select all

Module: Kernel::System::Console::Command::Maint::Stats::Generate
Params: Please check a cron task for examples (Daemon::SchedulerCronTaskManager::Task###TicketDraftDeleteExpired is pretty good).
There's an OTRS crontab already. You don't need to create a new one; just use the OTRS daemon.

Best regards and happy holidays
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Cron jobs not working

Post by jojo »

Using the Daemon for stats generation is possible but not very useful if you need several ones. I typically use the system crontab for this


The command you have to run on the CLI is bin/otrs.Console.pl Maint::Stats::Generate


@Emin: Managed or SaaS installations helps everyone who have no knowledge on operating *nix based systems in a production environment. Which here is the case as not even a check was made if the command would run...
"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
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Cron jobs not working

Post by zzz »

Thanks for sharing your experience.
Going for up to nine statistics is no problem in the GUI.
If you need more, you can also go for an OTRS-XML which will make sure that all your OTRS-Daemons will be managed at the same place.
But that's a matter of taste.

Best regards and happy holidays
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
naru
Znuny newbie
Posts: 9
Joined: 27 Aug 2019, 15:16
Znuny Version: 6.0.12

Re: Cron jobs not working

Post by naru »

Thanks Emin and jojo.

bin/otrs.Console.pl Maint::Stats::Generate worked for me. :D

Thanks,
Naru
Post Reply