1

Topic: cleanup_amavisd_db.py

==== Required information ====
- iRedMail version: 0.8.7 (Pro 1.8.2)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian Wheezy
- Related log if you're reporting an issue:
====

Hi, it seems that the cron job for cleanup_amavisd_db.py is not running, but from crontab -l -u root we see:
1   3   *   *   *   /usr/sbin/cbpadmin --config=/etc/cluebringer/cluebringer.conf --cleanup >/dev/null
# iRedMail: Cleanup Amavisd database
1  2   *   *   *   python /usr/share/apache2/iRedAdmin-0.3.1/tools/cleanup_amavisd_db.py &>/dev/null
# iRedMail: update Awstats statistics
1   */1   *   *   *   perl /usr/lib/cgi-bin/awstats.pl -config=web -update >/dev/null
1   */1   *   *   *   perl /usr/lib/cgi-bin/awstats.pl -config=smtp -update >/dev/null
# iRedMail: Backup MySQL databases on 03:30 AM
30   3   *   *   *   /bin/bash /var/vmail/backup/backup_mysql.sh


Should not that meen that the cron is running at 0201 every night?

(The cleanup works when executing it manualy)

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: cleanup_amavisd_db.py

Please edit root's cron job manually, and append an empty line at the bottom.
It's really weird that Debian/Ubuntu requires an empty line in cron job file...

3

Re: cleanup_amavisd_db.py

It seems that it was a space at the end, but I added another one, but do you know if it is any way to check if the job has ran in Debian? (As w see it seems that the job has not ran)

4

Re: cleanup_amavisd_db.py

Energia wrote:

1  2   *   *   *   python /usr/share/apache2/iRedAdmin-0.3.1/tools/cleanup_amavisd_db.py &>/dev/null

You can remove '&>/dev/null' in cron job.

This script will print some message in terminal if you run it manually, without '&>/dev/null', this output will trigger cron to mail output message to root user.

5

Re: cleanup_amavisd_db.py

We have chected this and it seems that the scipt does not run.

6

Re: cleanup_amavisd_db.py

Does other cron job run as expected?

7

Re: cleanup_amavisd_db.py

You said that the root user should get a mail about this, the root user have not have any messages, do you mean my default global admin?

8

Re: cleanup_amavisd_db.py

Does other cron jobs run as expected?

9

Re: cleanup_amavisd_db.py

As I said, I am a bit unsure how to fint out if it ran as expected...

10

Re: cleanup_amavisd_db.py

For example, you have below cron job:

1   3   *   *   *   /usr/sbin/cbpadmin --config=/etc/cluebringer/cluebringer.conf --cleanup >/dev/null

So does Policyd log some cleanup related log in Postfix log file?

30   3   *   *   *   /bin/bash /var/vmail/backup/backup_mysql.sh

Do you have daily backup file under /var/vmail/backup/?

11

Re: cleanup_amavisd_db.py

The only file we have under /var/vmail/backup, is backuo_mysql.sh

From /var/spool/cron/root:
# iRedMail: Cleanup Cluebringer database
1   3   *   *   *   /usr/sbin/cbpadmin --config=/etc/cluebringer/cluebringer.conf --cleanup >/dev/null
# iRedMail: Cleanup Amavisd database
1  2   *   *   *   python /usr/share/apache2/iRedAdmin-0.3.1/tools/cleanup_amavisd_db.py
# iRedMail: update Awstats statistics
1   */1   *   *   *   perl /usr/lib/cgi-bin/awstats.pl -config=web -update >/dev/null
1   */1   *   *   *   perl /usr/lib/cgi-bin/awstats.pl -config=smtp -update >/dev/null
# iRedMail: Backup MySQL databases on 03:30 AM
30   3   *   *   *   /bin/bash /var/vmail/backup/backup_mysql.sh

12

Re: cleanup_amavisd_db.py

Please edit root's cron job manually, and append an empty line at the bottom, or add a simple cron job to trigger crontab to correctly format cron job file.

It's really weird that Debian/Ubuntu requires an empty line in cron job file...

13

Re: cleanup_amavisd_db.py

I added a new simple cron job and it seems to be ok now.