fuel-library/deployment/puppet/anacron/files/0anacron-hourly
Przemyslaw Kaminski 549b9cbe72 Free disk check cron job for host monitoring
* Added script for creating a notification for the UI about disk space
  running low
* Added hourly cron job to run this script
* Added user 'monitord' being a tenant of 'services' with role 'monitoring'.
  This user is necessary to create notifications via Nailgun API.

This commit depends on python-fuelclient change:
https://review.openstack.org/#/c/150744/

Change-Id: I449e2d536330b8ad81bea508bb2f88907b7bf15d
Closes-Bug: #1371757
2015-03-02 14:37:15 +00:00

22 lines
547 B
Bash

#!/bin/bash
# managed by puppet
#
#!!! do not perform day checks here, cuz it would prevent hourly jobs from execution !!!
#in case file doesn't exist
#if test -r /var/spool/anacron/cron.daily; then
# day=`cat /var/spool/anacron/cron.daily`
#fi
#if [ `date +%Y%m%d` = "$day" ]; then
# exit 0;
#fi
#
# in case anacron is already running,
# there will be log (daemon won't be running twice).
if [[ -x /usr/bin/on_ac_power ]]; then
/usr/bin/on_ac_power &> /dev/null
if [[ $? -eq 1 ]]; then
exit 0
fi
fi
/usr/sbin/anacron -s