Creating a weekly maintenance script

The Zenoss Core databases require regular maintenance to perform optimally. This procedure creates a script for weekly invocation, to perform the required maintenance.
  1. Log in to the Control Center master host as root, or as a user with superuser privileges.
  2. Determine whether the cronie-anacron package is installed.
    1. Search the list of installed packages.
      rpm -qa | grep -i anacron
      • If the command returns no result, perform the next substep.
      • If the command returns a result, skip to the next step.
    2. Install the package, if necessary.
      yum install -y cronie-anacron
  3. Determine whether a script is already installed.
    Some packages of Zenoss Core install the script.
    ls -l /etc/cron.weekly
    • If the result includes serviced-zenossdbpack, the maintenance script is installed. Stop performing this procedure.
    • If the result does not include serviced-zenossdbpack, the maintenance script is installed. Complete this procedure.
  4. Create a shell script for weekly invocation.
    1. Open /etc/cron.weekly/serviced-zenossdbpack with a text editor.
      The file is empty.
    2. Add the following content to the file.
      #!/bin/sh
      ${SERVICED:=/opt/serviced/bin/serviced} service run zope zenossdbpack
    3. Save the file, and then close the text editor.
  5. Set file permissions.
    chmod 0755 /etc/cron.weekly/serviced/zenossdbpack