Topic: Cron Error and old Software under /opt/www
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
Last manual update was 1.7.3 and then machine was converted to iRedMail Enterprise.
iRedMail Enterprise reports version 1.7.2, and OpenLDAP Backend 2026041001
- Deployed with iRedMail Easy or the downloadable installer?
iRedMail Enterprise
- Linux/BSD distribution name and version:
Ubuntu 24.x
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
LDAP
- Web server (Apache or Nginx):
Nginx
- Manage mail accounts with iRedAdmin-Pro?
iRedMail Enterprise
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
After the most recent deployment of iRedMail Enterprise I started getting emails indicating a crontab path problem.
Specifically, I'm seeing:
python3: can't open file '/opt/www/iredadmin/tools/cleanup_amavisd_db.py': [Errno 2] No such file or directoryI find this execution string in root's crontab, and the directory it points to (/opt/www/iredadmin) does not exist. There are a couple of old directories that contain tools/cleanup_amavisd_db.py - iRedAdmin-Pro-LDAP-5.7 and iRedAdmin-Pro-LDAP-5.8.
/opt/www also appears to be where previous versions of Roundcube live - I have four versions in there, and the most recent one is symbolic linked to /opt/www/roundcubemail
ls -lat /opt/www/*
dr-xr-xr-x 13 iredadmin iredadmin 4096 Dec 30 2024 iRedAdmin-2.6
dr-xr-xr-x 13 iredadmin iredadmin 4096 Dec 31 2024 iRedAdmin-Pro-LDAP-5.7
drwxrwxr-x+ 2 root root 4096 Apr 11 2025 well_known
drwxrwxr-x 13 root root 4096 Apr 11 2025 roundcubemail-1.6.8
dr-xr-xr-x 13 iredadmin iredadmin 4096 Apr 11 2025 iRedAdmin-Pro-LDAP-5.8
drwxr-xr-x 13 root root 4096 Jul 2 2025 roundcubemail-1.6.10
drwxr-xr-x 13 root root 4096 Aug 12 2025 roundcubemail-1.6.11
lrwxrwxrwx 1 root root 29 Apr 19 22:52 roundcubemail -> /opt/www/roundcubemail-1.6.15
drwxr-xr-x 13 root root 4096 Apr 19 22:52 roundcubemail-1.6.15crontab -l
0 3 * * * /bin/bash /var/vmail/backup/backup_openldap.sh
# iRedMail: Backup MySQL databases at 03:30 AM.
30 3 * * * /bin/bash /var/vmail/backup/backup_mysql.sh
# iRedAPD: Clean up expired tracking records hourly.
1 * * * * python3 /opt/iredapd/tools/cleanup_db.py >/dev/null
# iRedAPD: Convert SPF DNS record of specified domain names to IP
# addresses/networks hourly.
2 * * * * python3 /opt/iredapd/tools/spf_to_greylist_whitelists.py >/dev/null
# iRedMail: Cleanup Amavisd database
1 2 * * * python3 /opt/www/iredadmin/tools/cleanup_amavisd_db.py >/dev/null
# iRedAdmin: Clean up sql database.
1 * * * * python3 /opt/www/iredadmin/tools/cleanup_db.py >/dev/null 2>&1
# iRedMail: Cleanup Roundcube SQL database
2 2 * * * /usr/bin/php /opt/www/roundcubemail/bin/cleandb.sh >/dev/null
# iRedMail: Cleanup Roundcube temporary files under 'temp/' directory
2 2 * * * /usr/bin/php /opt/www/roundcubemail/bin/gc.sh >/dev/null
# iRedMail: Backup SOGo data databases on 04:01AM
1 4 * * * /bin/bash /var/vmail/backup/backup_sogo.sh
# Fail2ban: Unban IP addresses pending for removal (stored in SQL db).
* * * * * /bin/bash /usr/local/bin/fail2ban_banned_db unban_db
# iRedAPD: Clean up expired tracking records hourly.
1 * * * * /usr/bin/python3 /opt/iredapd/tools/cleanup_db.py >/dev/null
# Scan spam/ham reported by end users.
*/10 * * * * /bin/bash /opt/iredmail/bin/dovecot/scan_reported_mails >/dev/null
# mlmmj: maintenance for mailing lists.
0 */2 * * * find /var/vmail/mlmmj -mindepth 1 -maxdepth 1 -type d -exec /usr/bin/mlmmj-maintd -F -d {} \;
# Roundcube: cleanup Roundcube SQL database
2 2 * * * /usr/bin/php /opt/www/roundcubemail/bin/cleandb.sh >/dev/null
# Roundcube: cleanup Roundcube temporary files.
3 2 * * * /usr/bin/php /opt/www/roundcubemail/bin/gc.sh >/dev/null
# iRedMail: Apply all custom settings after system reboot.
@reboot /bin/bash /opt/iredmail/bin/apply_all_custom_settings
# SOGo: Backup data.
1 4 * * * /bin/bash /var/vmail/backup/backup_sogo.shMy questions:
- Are all of the entries in root's crontab relevant still? Should any of them need be removed or edited? If they are supposed to be there and running, where do I point the ones that will fail due to /opt/www/iredadmin not existing?
- What can I safely delete within /opt/www to clean up the old versions?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.