1 (edited by laserlight 2016-05-20 10:46:45)

Topic: cleanup_db.py no longer works after upgrading to 0.9.2

======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: Ubuntu 14.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

After upgrading from 0.9.0 -> 0.9.1 -> 0.9.2, I have been getting notification emails to the postmaster account with this content:
Cron <root@mail> /usr/share/apache2/iredadmin/tools/cleanup_db.py &>/dev/null

/usr/share/apache2/iredadmin/tools/cleanup_db.py: 25: /usr/share/apache2/iredadmin/tools/cleanup_db.py: import: not found
/usr/share/apache2/iredadmin/tools/cleanup_db.py: 26: /usr/share/apache2/iredadmin/tools/cleanup_db.py: import: not found
/usr/share/apache2/iredadmin/tools/cleanup_db.py: 27: /usr/share/apache2/iredadmin/tools/cleanup_db.py: import: not found
/usr/share/apache2/iredadmin/tools/cleanup_db.py: 29: /usr/share/apache2/iredadmin/tools/cleanup_db.py: os.environ[LC_ALL]: not found
/usr/share/apache2/iredadmin/tools/cleanup_db.py: 31: /usr/share/apache2/iredadmin/tools/cleanup_db.py: Syntax error: "(" unexpected

The relevant lines in cleanup_db.py are:

import os
import sys
import web

os.environ['LC_ALL'] = 'C'

rootdir = os.path.abspath(os.path.dirname(__file__)) + '/../'

which seem strange because os and sys should be standard Python modules. How should I go about fixing this? Thanks!

----

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

2

Re: cleanup_db.py no longer works after upgrading to 0.9.2

Please update your cron job, run it with python command like this:

1   *   *   *   *   python /usr/share/apache2/iredadmin/tools/cleanup_db.py >/dev/null