Difference between revisions of "Step to rebuilt crontab file of zimbra user"

 
Line 1: Line 1:
==<h1>Step to rebuilt crontab file of zimbra user</h1>==
+
{{BC|Certified}}
 +
__FORCETOC__
 +
<div class="col-md-12 ibox-content">
 +
==Step to rebuilt crontab file of zimbra user==  
 
<hr>
 
<hr>
<br>
+
{{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 8.7}}|{{ZCS 8.6}}|{{ZCS 8.5}}|}}
<h2>Problem</h2>
+
{{WIP}}
  
Default crontab of zimbra user removed accidentally.<br>
 
'''OR'''<br>
 
System admin removed some entries from the crontab file.
 
  
<h2>Solution</h2>
+
 
 +
==Problem==
 +
* Default crontab of zimbra user removed accidentally.
 +
* System admin removed some entries from the crontab file.
 +
 
 +
 
 +
==Solution==
  
 
Steps to restore or rebuilt crontab entries for the zimbra user on different ZCS environments.
 
Steps to restore or rebuilt crontab entries for the zimbra user on different ZCS environments.
Line 111: Line 117:
  
  
 +
{| class="wikitable" style="background-color:#d0f0c0;" cellpadding="10"
 +
|'''Submitted by''':  Heera Singh Koranga
 +
|}
  
Submitted by:  Heera Singh Koranga
+
{{Article Footer|ZCS 8.8, 8.7, 8.6|2017-08-23}}

Latest revision as of 08:21, 17 August 2018

Step to rebuilt crontab file of zimbra user


   KB 23338        Last updated on 2018-08-17  




0.00
(0 votes)



Problem

  • Default crontab of zimbra user removed accidentally.
  • System admin removed some entries from the crontab file.


Solution

Steps to restore or rebuilt crontab entries for the zimbra user on different ZCS environments.

(A) Steps for single-server setup:

First we have to take backup of current crontab file, then we will use following commands to re-built crontab for zimbra user.

On ZCS v8.6:

cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK  
cat /opt/zimbra/zimbramon/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/zimbramon/crontabs/crontab.ldap >> /tmp/cron.zimbra
cat /opt/zimbra/zimbramon/crontabs/crontab.store >> /tmp/cron.zimbra
cat /opt/zimbra/zimbramon/crontabs/crontab.logger >> /tmp/cron.zimbra
cat /opt/zimbra/zimbramon/crontabs/crontab.mta >> /tmp/cron.zimbra
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra 
crontab -u zimbra /tmp/cron.zimbra   
su - zimbra -c "zmschedulebackup -D" 

On ZCS v8.7.x:

cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK  
cat /opt/zimbra/conf/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.ldap >> /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.store >> /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.logger >> /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.mta >> /tmp/cron.zimbra
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra 
crontab -u zimbra /tmp/cron.zimbra   
su - zimbra -c "zmschedulebackup -D" 


(B) Steps for multi-server setup:

Here we have mentioned the commands according to the role of ZCS server.

On ZCS v8.6:

LDAP Server:
cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK 
cat /opt/zimbra/zimbramon/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/zimbramon/crontabs/crontab.ldap >> /tmp/cron.zimbra  
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra  
crontab -u zimbra /tmp/cron.zimbra   
su - zimbra -c "zmschedulebackup -D" 
Mailbox Server:
cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK 
cat /opt/zimbra/zimbramon/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/zimbramon/crontabs/crontab.store >> /tmp/cron.zimbra
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra  
crontab -u zimbra /tmp/cron.zimbra   
su - zimbra -c "zmschedulebackup -D" 
/etc/init.d/crond restart
MTA+Proxy Server:
cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK  
cat /opt/zimbra/zimbramon/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/zimbramon/crontabs/crontab.mta >> /tmp/cron.zimbra
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra 
crontab -u zimbra /tmp/cron.zimbra   


On ZCS v8.7.x:

LDAP Server:
cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK 
cat /opt/zimbra/conf/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.ldap >> /tmp/cron.zimbra  
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra  
crontab -u zimbra /tmp/cron.zimbra   
su - zimbra -c "zmschedulebackup -D" 
Mailbox Server:
cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK 
cat /opt/zimbra/conf/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.store >> /tmp/cron.zimbra
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra  
crontab -u zimbra /tmp/cron.zimbra   
su - zimbra -c "zmschedulebackup -D" 
MTA+Proxy Server:
cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK  
cat /opt/zimbra/conf/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.mta >> /tmp/cron.zimbra
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra 
crontab -u zimbra /tmp/cron.zimbra   


Note : We have to restart Cron service after installing new crontab file.

Commands to restart Cron service on different OS versions.

Ubuntu 12.04/14.04/16.04

service cron restart

RHEL/CentOS 7.x

systemctl restart crond

RHEL/CentOS 6.x

service crond restart


Submitted by: Heera Singh Koranga
Verified Against: ZCS 8.8, 8.7, 8.6 Date Created: 2017-08-23
Article ID: https://wiki.zimbra.com/index.php?title=Step_to_rebuilt_crontab_file_of_zimbra_user Date Modified: 2018-08-17



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Jump to: navigation, search