~jeff-apple/openvista-gtm-integration/bug360710

« back to all changes in this revision

Viewing changes to scripts/etc/cron.daily/openvista

  • Committer: Jonathan Tai
  • Date: 2009-02-13 02:44:20 UTC
  • mfrom: (1.1.36 scripts+packaging)
  • Revision ID: jon.tai@medsphere.com-20090213024420-dssgk67iztyi7y8s
Merge scripts+packaging branch into mainline to lay the foundation for other work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# This script backs up OpenVista instances that have backup_daily set to "yes"
 
4
# in their etc/backups.conf.
 
5
#
 
6
# The /etc/cron.daily/openvista script runs once per day and backs up instances
 
7
# one after another to avoid excessive I/O from all the instances being backed
 
8
# up simultaneously.
 
9
#
 
10
# If you want an instance to be backed up on a custom schedule, set
 
11
# backup_daily to "no" in its etc/backups.conf and add an entry for this
 
12
# instance in /etc/cron.d/openvista.
 
13
 
 
14
 
 
15
# Copyright (C) 2009 Medsphere Systems Corporation
 
16
#
 
17
# This program is free software; you can redistribute it and/or modify it solely
 
18
# under the terms of the GNU Affero General Public License version 3 as published
 
19
# by the Free Software Foundation.
 
20
 
21
# This program is distributed in the hope that it will be useful, but WITHOUT
 
22
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
23
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License
 
24
# for more details.
 
25
 
26
# You should have received a copy of the GNU Affero General Public License
 
27
# along with this program.  If not, see <http://www.gnu.org/licenses>.
 
28
 
29
# You can contact Medsphere Systems Corporation headquarters at 1917 Palomar 
 
30
# Oaks Way, Suite 200, Carlsbad, CA 92008 or at legal@medsphere.com.
 
31
 
 
32
 
 
33
root="/opt/openvista"
 
34
 
 
35
for instance in `ls $root`; do
 
36
    # the default is "yes" unless the etc/backups.conf file exists and it has
 
37
    # backup_daily set to "no"... in other words, an instance has to "opt out"
 
38
    backup_daily=yes
 
39
 
 
40
    if [ -e "$root/$instance/etc/backups.conf" ]; then
 
41
        . "$root/$instance/etc/backups.conf" 
 
42
    fi
 
43
 
 
44
    case "$backup_daily" in
 
45
        ""|"no"|"No"|"NO"|"false"|"False"|"FALSE"|"0")
 
46
            # skip backing up this instance
 
47
            ;;
 
48
        *)
 
49
            ovbackup "$instance"
 
50
            ;;
 
51
    esac 
 
52
done