Scheduling jobs
This guide describes jobs that supervisor executing on correspond servers at scheduled time.
On this page assumed that variable
INSTALL_DIRhas 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
Make sure that PYTHONPATH matches:
PYTHONPATH="/opt/workfusion/python-site/lib/python2.7/site-packages:/opt/workfusion/python-site/lib64/python2.7/site-packages"Logrotate
/usr/sbin/logrotate -s /opt/workfusion/logrotate/status /opt/workfusion/logrotate/logrotate.conf > /dev/null 2>&1Elasticsearch retention
/opt/workfusion/python-site/bin/curator --config /opt/workfusion/elasticsearch-curator/config.yml /opt/workfusion/elasticsearch-curator/actions.ymlZookeper snapshots cleanup
bash -l /opt/workfusion/zookeeper/bin/cleanupSnapshots.sh >> /opt/workfusion/zookeeper/log/zkclean.logLogstash 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>&1Logstash 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
Logrotate.
/usr/sbin/logrotate -s /opt/workfusion/logrotate/status /opt/workfusion/logrotate/logrotate.conf > /dev/null 2>&1Mesos clean runtime directory.
/usr/bin/find /opt/workfusion/mesos/runtime/containers/* -delete > /dev/null 2>&1Clear VDS services temp files.
find /opt/workfusion/tmp/* -mtime +3 -delete
Agent
Logrotate.
/usr/sbin/logrotate -s /opt/workfusion/logrotate/status /opt/workfusion/logrotate/logrotate.conf > /dev/null 2>&1Mesos clean runtime directory.
/usr/bin/find /opt/workfusion/mesos/runtime/containers/* -delete > /dev/null 2>&1Clear 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