Lines 34-46
Options:
Link Here
|
34 |
(default: 2) |
34 |
(default: 2) |
35 |
--exclude-indexes Exclude Zebra indexes from the backups (default: false) |
35 |
--exclude-indexes Exclude Zebra indexes from the backups (default: false) |
36 |
|
36 |
|
|
|
37 |
--db-only-zip Only include the Database dump in backup (default: false) |
38 |
|
37 |
Note: backups produced using this tool can be restored using \`koha-restore'. |
39 |
Note: backups produced using this tool can be restored using \`koha-restore'. |
38 |
EOH |
40 |
EOH |
39 |
} |
41 |
} |
40 |
|
42 |
|
41 |
exclude_indexes="" |
43 |
exclude_indexes="" |
|
|
44 |
db_only_zip="" |
42 |
|
45 |
|
43 |
CMD_LINE=`getopt -o h --long days:,output:,help,exclude-indexes -n 'koha-run-backups' -- "$@"` |
46 |
CMD_LINE=`getopt -o h --long days:,output:,help,exclude-indexes,db-only-zip -n 'koha-run-backups' -- "$@"` |
44 |
|
47 |
|
45 |
if [ $? != 0 ] ; then show_help ; exit 1 ; fi |
48 |
if [ $? != 0 ] ; then show_help ; exit 1 ; fi |
46 |
|
49 |
|
Lines 55-75
while true ; do
Link Here
|
55 |
dirname=$2; shift 2 ;; |
58 |
dirname=$2; shift 2 ;; |
56 |
--exclude-indexes) |
59 |
--exclude-indexes) |
57 |
exclude_indexes='--exclude-indexes'; shift ;; |
60 |
exclude_indexes='--exclude-indexes'; shift ;; |
|
|
61 |
--db-only-zip) |
62 |
db_only_zip='--db-only-zip'; shift ;; |
58 |
--) shift ; break ;; |
63 |
--) shift ; break ;; |
59 |
*) echo "Unknown error parsing the command line!" ; exit 1 ;; |
64 |
*) echo "Unknown error parsing the command line!" ; exit 1 ;; |
60 |
esac |
65 |
esac |
61 |
done |
66 |
done |
62 |
|
|
|
63 |
if ! test $days -gt 0 ; then |
67 |
if ! test $days -gt 0 ; then |
64 |
echo "Parameter --days must be an integer greater than 0" |
68 |
echo "Parameter --days must be an integer greater than 0" |
65 |
exit 1 |
69 |
exit 1 |
66 |
fi |
70 |
fi |
67 |
|
|
|
68 |
for name in $(koha-list --enabled | grep -Fxv demo) |
71 |
for name in $(koha-list --enabled | grep -Fxv demo) |
69 |
do |
72 |
do |
70 |
if koha-dump ${exclude_indexes} "$name" > /dev/null; then |
73 |
if koha-dump ${exclude_indexes} ${db_only_zip} "$name" > /dev/null; then |
71 |
# Only delete old backups if dump script return success. |
74 |
# Only delete old backups if dump script return success. |
72 |
|
|
|
73 |
if [ -z "$dirname" ]; then |
75 |
if [ -z "$dirname" ]; then |
74 |
backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )"; |
76 |
backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )"; |
75 |
else |
77 |
else |
76 |
- |
|
|