Revision 6e3bf290 daemons/ganeti-cleaner.in

b/daemons/ganeti-cleaner.in
1 1
#!/bin/bash
2 2
#
3 3

  
4
# Copyright (C) 2009, 2010, 2011 Google Inc.
4
# Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
18 18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 19
# 02110-1301, USA.
20 20

  
21
set -e
21
set -e -u
22

  
23
@SHELL_ENV_INIT@
24

  
25
# Overridden by unittest
26
: ${CHECK_CERT_EXPIRED:=$PKGLIBDIR/check-cert-expired}
27

  
28
readonly CLEANER_LOG_DIR=$LOG_DIR/cleaner
29
readonly QUEUE_ARCHIVE_DIR=$DATA_DIR/queue/archive
30
readonly CRYPTO_DIR=$RUN_DIR/crypto
22 31

  
23 32
in_cluster() {
24 33
  [[ -e $DATA_DIR/ssconf_master_node ]]
......
60 69
  xargs -r0 rm -vf
61 70
}
62 71

  
63
# Overridden by unittest
64
: ${LOCALSTATEDIR:=@LOCALSTATEDIR@}
65
: ${CHECK_CERT_EXPIRED:=@PKGLIBDIR@/check-cert-expired}
66

  
67
DATA_DIR=$LOCALSTATEDIR/lib/ganeti
68
CLEANER_LOG_DIR=$LOCALSTATEDIR/log/ganeti/cleaner
69
QUEUE_ARCHIVE_DIR=$DATA_DIR/queue/archive
70
CRYPTO_DIR=$LOCALSTATEDIR/run/ganeti/crypto
71

  
72 72
# Define how many days archived jobs should be left alone
73 73
REMOVE_AFTER=21
74 74

  

Also available in: Unified diff