Skip to main content
Version: 10.2.4

Scheduling jobs

This guide describes jobs that supervisor executing on correspond servers at scheduled time.

  • On this page assumed that variable INSTALL_DIR has default value /opt/workfusion.

  • Scheduled time is specified in the {{ supervisord_home }}/conf/cron.sh file.

  • Events that trigger executing cron.sh file are specified in {{ supervisord_home }}/conf/supervisord.conf.

Master​

  1. Make sure that PYTHONPATH matches:

    PYTHONPATH="/opt/workfusion/python-site/lib/python2.7/site-packages:/opt/workfusion/python-site/lib64/python2.7/site-packages"
  2. Logrotate

    /usr/sbin/logrotate -s /opt/workfusion/logrotate/status /opt/workfusion/logrotate/logrotate.conf > /dev/null 2>&1
  3. Elasticsearch retention

    /opt/workfusion/python-site/bin/curator --config /opt/workfusion/elasticsearch-curator/config.yml /opt/workfusion/elasticsearch-curator/actions.yml
  4. Zookeper snapshots cleanup

    bash -l /opt/workfusion/zookeeper/bin/cleanupSnapshots.sh >> /opt/workfusion/zookeeper/log/zkclean.log
  5. Logstash gzip logs

    find /opt/workfusion/logs ! -name '*.gz' -type f -daystart -mtime +0 -exec gzip --suffix "."$(date +"\%Y-\%m-\%d_\%H:\%M:\%S")".gz" {} + > /dev/null 2>&1
  6. Logstash cleanup logs

    find /opt/workfusion/logs -mindepth 4 -maxdepth 4 -type d -mtime +7 -exec rm -rf {} + > /dev/null 2>&1

Master server​

Logrotate.

/usr/sbin/logrotate -s /opt/workfusion/logrotate/status /opt/workfusion/logrotate/logrotate.conf > /dev/null 2>&1

Master​

  1. Logrotate.

    /usr/sbin/logrotate -s /opt/workfusion/logrotate/status /opt/workfusion/logrotate/logrotate.conf > /dev/null 2>&1
  2. Mesos clean runtime directory.

    /usr/bin/find /opt/workfusion/mesos/runtime/containers/* -delete > /dev/null 2>&1
  3. Clear VDS services temp files.

    find /opt/workfusion/tmp/*  -mtime +3  -delete

Agent​

  1. Logrotate.

    /usr/sbin/logrotate -s /opt/workfusion/logrotate/status /opt/workfusion/logrotate/logrotate.conf > /dev/null 2>&1
  2. Mesos clean runtime directory.

    /usr/bin/find /opt/workfusion/mesos/runtime/containers/* -delete > /dev/null 2>&1
  3. Clear VDS services temp files.

    find /opt/workfusion/tmp/*  -mtime +3  -delete

OCR Server​

Logrotate.

/usr/sbin/logrotate -s /opt/workfusion/logrotate/status /opt/workfusion/logrotate/logrotate.conf > /dev/null 2>&1