Well, i've read through the entire thread again. This is what i have:
No duplicate entries in cron:
Code: Select all
crontab -l -u otrs
# Who gets the cron emails?
#MAILTO="info@xxxxx.xx"
# 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
# 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
# generate dashboard stats every hour
5 * * * * $HOME/bin/otrs.GenerateDashboardStats.pl >> /dev/null
# 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
# start generic agent every 10 minutes
*/10 * * * * $HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null
# check every 120 min the pending jobs
45 */2 * * * $HOME/bin/otrs.PendingJobs.pl >> /dev/null
# check daily the spool directory of OTRS
10 0 * * * $HOME/bin/otrs.ReprocessMails.pl >> /dev/null
# fetch emails every 1 minute
*/1 * * * * $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
# just every day
01 01 * * * $HOME/bin/otrs.RebuildTicketIndex.pl >> /dev/null
# check scheduler status
*/5 * * * * $HOME/bin/otrs.Scheduler.pl -w 1 >> /dev/null
# delete every 120 minutes old/idle session ids
55 */2 * * * $HOME/bin/otrs.DeleteSessionIDs.pl --expired >> /dev/null
# unlock every hour old locked tickets
35 * * * * $HOME/bin/otrs.UnlockTickets.pl --timeout >> /dev/null
I checked which user is running cron:
Code: Select all
cd /var/spool/cron/crontabs
grep otrs *
otrs:20 0 * * 0 $HOME/bin/otrs.DeleteCache.pl --expired >> /dev/null
otrs:30 0 * * 0 $HOME/bin/otrs.LoaderCache.pl -o delete >> /dev/null
otrs:5 * * * * $HOME/bin/otrs.GenerateDashboardStats.pl >> /dev/null
otrs:*/20 * * * * $HOME/bin/otrs.GenericAgent.pl >> /dev/null
otrs:# example to execute otrs.GenericAgent.pl on 23:00 with
otrs:#0 23 * * * $HOME/bin/otrs.GenericAgent.pl -c "Kernel::Config::GenericAgentMove" >> /dev/null
otrs:*/10 * * * * $HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null
otrs:45 */2 * * * $HOME/bin/otrs.PendingJobs.pl >> /dev/null
otrs:10 0 * * * $HOME/bin/otrs.ReprocessMails.pl >> /dev/null
otrs:*/1 * * * * $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
otrs:01 01 * * * $HOME/bin/otrs.RebuildTicketIndex.pl >> /dev/null
otrs:*/5 * * * * $HOME/bin/otrs.Scheduler.pl -w 1 >> /dev/null
otrs:55 */2 * * * $HOME/bin/otrs.DeleteSessionIDs.pl --expired >> /dev/null
otrs:35 * * * * $HOME/bin/otrs.UnlockTickets.pl --timeout >> /dev/null
This is what i have in /opt/otrs/var/cron:
Code: Select all
/opt/otrs/var/cron# ls
aaa_base cache.dist generate_dashboard_stats generic_agent-database pending_jobs postmaster.dist rebuild_ticket_index scheduler_watchdog.dist unlock
aaa_base.dist fetchmail generate_dashboard_stats.dist generic_agent-database.dist pending_jobs.dist postmaster_mailbox rebuild_ticket_index.dist session unlock.dist
cache fetchmail.dist generic_agent generic_agent.dist postmaster postmaster_mailbox.dist scheduler_watchdog session.dist
Finally this is an example of the permissions on what of the files that gives the cron error:
Code: Select all
root@backup:/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7# ls -l
total 4
-rw-rw---- 1 www-data www-data 306 Aug 18 14:35 6732332f2164b22a374a2cd7c080aea3
I'm on Ubuntu 14 and i used this to set the permissions:
Code: Select all
bin/otrs.SetPermissions.pl --otrs-user=otrs --web-user=www-data --otrs-group=www-data --web-group=www-data /opt/otrs
I was also getting cron e-mails about the files ZZZAuto.pm and ZZZAAuto.pm saying Access Denied.
However i got rid of those errors when i did chmod 664 on them.
Where did i go wrong?
Update:
I did this according to the Ubuntu guide:
https://help.ubuntu.com/community/OTRS
Code: Select all
root@backup:/opt/otrs/bin# sudo ./otrs.SetPermissions.pl --otrs-user=otrs --otrs-group=otrs --web-user=www-data --web-group=www-data /opt/otrs
Unknown option: otrs-group
Unknown option: web-user
Setting permissions on /opt/otrs
What do the unknown option messesages mean?
It seems to change the permission of the cache file anyway:
Code: Select all
cd /opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7
ls -l
-rw-rw---- 1 otrs www-data 306 Aug 18 14:35 6732332f2164b22a374a2cd7c080aea3
update2:
I was silently hoping that the permissions change fixed it but i just got another cron e-mail again:
Code: Select all
ERROR: OTRS-otrs.GenericAgent.pl-10 Perl: 5.18.2 OS: linux Time: Tue Aug 18 15:40:02 2015
Message: Can't write '/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7/6732332f2164b22a374a2cd7c080aea3': Permission denied
This is what the file looks like:
Code: Select all
/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7# ls -l
total 4
-rw-rw---- 1 www-data www-data 306 Aug 18 15:36 6732332f2164b22a374a2cd7c080aea3
root@backup:/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7#
So when i ran the otrs.SetPermissions.pl script it had set otrs as the owner of the file and now the new cache files that have been generated are owned by apache www-data. Would this be the cause of the problem?