1

Topic: Accidentally deleted cronjobs

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

Hello,

As root, I accidentally ran crontab -r instead of -e, and lost all my cronjobs.

Is there a way to recreate the cronjobs?

Thank you!

----

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

2

Re: Accidentally deleted cronjobs

An easy way to get them backup is setting up a new virtual machine and install iRedMail.

3

Re: Accidentally deleted cronjobs

I was hoping to avoid that, and just get the paths of the backup scripts to manually recreate the crontab.


Thanks again Mr. Zhang, I'll install a VM now.

4

Re: Accidentally deleted cronjobs

In case anyone needed them:


*/30 * * * * python /opt/iredapd/tools/spf_to_greylist_whitelists.py >/dev/null
# iRedMail: Cleanup Amavisd database
1 2 * * * python /opt/www/iredadmin/tools/cleanup_amavisd_db.py >/dev/null

# iRedMail: Cleanup Roundcube SQL database
2 2 * * * /usr/bin/php /opt/www/roundcubemail/bin/cleandb.sh >/dev/null

# iRedMail: update Awstats statistics for web
1 */1 * * * /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=web -update >/dev/null

# iRedMail: update Awstats statistics for smtp
1 */1 * * * /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=smtp -update >/dev/null

5

Re: Accidentally deleted cronjobs

This is not full tasks. for example, it doesn't have tasks to run backup scripts.