From c713c3ab953372d7e9efeda03e87dcf1332eb043 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 23 Sep 2014 15:37:02 -0300 Subject: [PATCH] Puppet: tarefas periodicas na cron --- etc/cron.daily/sigi | 4 ---- etc/cron.hourly/sigi | 3 --- puppet/manifests/site.pp | 21 +++++++++++++++++++++ 3 files changed, 21 insertions(+), 7 deletions(-) delete mode 100644 etc/cron.daily/sigi delete mode 100644 etc/cron.hourly/sigi diff --git a/etc/cron.daily/sigi b/etc/cron.daily/sigi deleted file mode 100644 index 2770a84..0000000 --- a/etc/cron.daily/sigi +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd /srv/sigi/sigi/ -python manage.py atualiza_uso_servico -v 0 -python manage.py clearsessions -v 0 diff --git a/etc/cron.hourly/sigi b/etc/cron.hourly/sigi deleted file mode 100644 index 0017b2f..0000000 --- a/etc/cron.hourly/sigi +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -cd /srv/sigi/sigi -python manage.py gera_map_data diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index e63e55f..068e284 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -174,3 +174,24 @@ nginx::resource::location { '/media/': vhost => $sigi_vhost, location_alias => '/srv/sigi/media/', } + +########################################################################### +# CRON + +cron { 'atualiza_uso_servico': + command => "${sigi_venv_dir}/bin/python ${sigi_dir}/manage.py atualiza_uso_servico -v 0", + user => 'sigi', + hour => [0,] +} + +cron { 'clearsessions': + command => "${sigi_venv_dir}/bin/python ${sigi_dir}/manage.py clearsessions -v 0", + user => 'sigi', + hour => [0,] +} + +cron { 'gera_map_data': + command => "${sigi_venv_dir}/bin/python ${sigi_dir}/manage.py gera_map_data", + user => 'sigi', + hour => "*/1", +}