View | Details | Raw Unified | Return to bug 21111
Collapse All | Expand All

(-)a/debian/docs/koha-run-backups.xml (+7 lines)
Lines 46-51 Link Here
46
      </listitem>
46
      </listitem>
47
    </varlistentry>
47
    </varlistentry>
48
48
49
    <varlistentry>
50
      <term><option>--exclude-indexes</option></term>
51
      <listitem>
52
        <para>Exclude Zebra indexes from the backups (default: false).</para>
53
      </listitem>
54
    </varlistentry>
55
49
  </variablelist>
56
  </variablelist>
50
  </refsect1>
57
  </refsect1>
51
58
(-)a/debian/scripts/koha-run-backups (-7 / +11 lines)
Lines 28-43 This allows automation of backing up the koha data and configuration to the Link Here
28
filesystem. It will keep the past so many backups, discarding older ones.
28
filesystem. It will keep the past so many backups, discarding older ones.
29
29
30
Options:
30
Options:
31
    --output:   the directory that the resulting files will be placed into.
31
    --output /path     The directory that the resulting files will be placed into.
32
                (default: /var/spool/koha)
32
                       (default: /var/spool/koha)
33
    --days:     the number of days to keep backups around for
33
    --days 2           The number of days to keep backups around for
34
                (default: 2)
34
                       (default: 2)
35
    --exclude-indexes  Exclude Zebra indexes from the backups (default: false)
35
36
36
Note: backups produced using this tool can be restored using \`koha-restore'.
37
Note: backups produced using this tool can be restored using \`koha-restore'.
37
EOH
38
EOH
38
}
39
}
39
40
40
CMD_LINE=`getopt -o h --long days:,output:,help -n 'koha-run-backups' -- "$@"`
41
exclude_indexes=""
42
43
CMD_LINE=`getopt -o h --long days:,output:,help,exclude-indexes -n 'koha-run-backups' -- "$@"`
41
44
42
if [ $? != 0 ] ; then show_help ; exit 1 ; fi
45
if [ $? != 0 ] ; then show_help ; exit 1 ; fi
43
46
Lines 50-55 while true ; do Link Here
50
            days=$2; shift 2 ;;
53
            days=$2; shift 2 ;;
51
        --output)
54
        --output)
52
            dirname=$2; shift 2 ;;
55
            dirname=$2; shift 2 ;;
56
        --exclude-indexes)
57
            exclude_indexes='--exclude-indexes'; shift ;;
53
        --) shift ; break ;;
58
        --) shift ; break ;;
54
        *) echo "Unknown error parsing the command line!" ; exit 1 ;;
59
        *) echo "Unknown error parsing the command line!" ; exit 1 ;;
55
    esac
60
    esac
Lines 57-63 done Link Here
57
62
58
for name in $(koha-list --enabled | grep -Fxv demo)
63
for name in $(koha-list --enabled | grep -Fxv demo)
59
do
64
do
60
    koha-dump "$name" > /dev/null
65
    koha-dump ${exclude_indexes} "$name" > /dev/null
61
    if [ -z "$dirname" ]; then
66
    if [ -z "$dirname" ]; then
62
        backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )";
67
        backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )";
63
    else
68
    else
64
- 

Return to bug 21111