summaryrefslogtreecommitdiff
path: root/puppet/modules/site_webapp/manifests/cron.pp
blob: bdf0fb7440ba93609795fa8e5cc5c035215343a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class site_webapp::cron {

  # cron tasks that need to be performed to cleanup the database
  cron {
    'rotate_databases':
      command     => 'cd /srv/leap/webapp && bundle exec rake db:rotate',
      environment => 'RAILS_ENV=production',
      hour        => [0,6,12,18],
      minute      => 0;

    'delete_tmp_databases':
      command     => 'cd /srv/leap/webapp && bundle exec rake db:deletetmp',
      environment => 'RAILS_ENV=production',
      hour        => 1,
      minute      => 1;

    'remove_expired_sessions':
      command     => 'cd /srv/leap/webapp && bundle exec rake cleanup:sessions',
      environment => 'RAILS_ENV=production',
      hour        => 2,
      minute      => 30;

    'remove_expired_tokens':
      command     => 'cd /srv/leap/webapp && bundle exec rake cleanup:tokens',
      environment => 'RAILS_ENV=production',
      hour        => 3,
      minute      => 0;
  }
}