1

Topic: Cron Errors

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

suddenly I have been getting a lot of emails regarding cron errors. They just started out of the blue and I think its to do with permissions but not totally sure. Nothing has changed or been altered. It just started hapening. Here is what i get in 2 seperate Emails.

/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 26: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: import: not found
/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 27: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: import: not found
from: can't read /var/mail/ConfigParser
/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 29: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: import: not found
/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 31: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: os.environ[LC_ALL]: not found
/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 33: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: Syntax error: "(" unexpected


And then

bash: /var/backup/backup_mysql.sh: No such file or directory


The above file is clearly there as i can access it with root shell but it wont when not invoking root.

----

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

2

Re: Cron Errors

JJ wrote:

/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 26: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: import: not found
/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 27: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: import: not found
from: can't read /var/mail/ConfigParser
/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 29: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: import: not found
/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 31: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: os.environ[LC_ALL]: not found
/usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: 33: /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py: Syntax error: "(" unexpected

Looks like this Python script was executed as a shell script.

Please show us output of below command:

# crontab -l -u root

3

Re: Cron Errors

As requested


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/backup/backup_mysql.sh
20   4   *   *   *   rsync -a --delete /var/vmail/  /var/backup/
15   12  *   *   *   /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py
1   3   *   *   *   /usr/sbin/cbpadmin --config=/etc/cluebringer/cluebringer.conf --cleanup > /dev/null

4

Re: Cron Errors

JJ wrote:

15   12  *   *   *   /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py

Please execute it with python. for example:

15   12  *   *   *   python /usr/share/apache2/iRedAdmin-Pro-MySQL-1.7.0/tools/cleanup_amavisd_db.py

5

Re: Cron Errors

Ok I will change that what about the inability to find the backup script? It says it doesnt exist yet it is clearly there if I browse to it. I can execute i from shell but cron says it cant be found.

6

Re: Cron Errors

I guess you typed wrong path. it should be /var/vmail/backup/backup_mysql.sh, you missed 'vmail' in path.

7

Re: Cron Errors

Ok changed that will check and see how it goes. The python script is working without errors now too so thats good.