Lines 44-49
$scriptname [--quiet|-q] [--exclude-indexes] instancename1 [instancename2...]
Link Here
|
44 |
$scriptname -h|--help |
44 |
$scriptname -h|--help |
45 |
|
45 |
|
46 |
--exclude-indexes Include Zebra indexes on the backup. |
46 |
--exclude-indexes Include Zebra indexes on the backup. |
|
|
47 |
--uploaded_files Include uploaded files. |
48 |
--uploaded_temp_files Include temporary uploaded files. |
47 |
--quiet|-q Make the script avoid printing to STDOUT |
49 |
--quiet|-q Make the script avoid printing to STDOUT |
48 |
(useful for calling from another scripts). |
50 |
(useful for calling from another scripts). |
49 |
--help|-h Display this help message |
51 |
--help|-h Display this help message |
Lines 79-97
dump_instance()
Link Here
|
79 |
|
81 |
|
80 |
# Dump configs, logs, etc. |
82 |
# Dump configs, logs, etc. |
81 |
metadump="$backupdir/$name-$date.tar.gz" |
83 |
metadump="$backupdir/$name-$date.tar.gz" |
82 |
[ "$quiet" = "no" ] && echo "* configs, logs to $metadump" |
84 |
[ "$quiet" = "no" ] && echo "* configs, files, logs to $metadump" |
83 |
|
85 |
|
84 |
if [ "$exclude_indexes" = "yes" ]; then |
86 |
if [ "$exclude_indexes" = "yes" ]; then |
85 |
excludes="--exclude=var/lib/koha/$name/biblios \ |
87 |
excludes="--exclude=var/lib/koha/$name/biblios \ |
86 |
--exclude=var/lib/koha/$name/authorities" |
88 |
--exclude=var/lib/koha/$name/authorities" |
87 |
fi |
89 |
fi |
88 |
|
90 |
|
|
|
91 |
if [ "$uploaded_files" = "yes" ]; then |
92 |
# Remove leading / |
93 |
uploaded_files_dir=$(echo $(get_upload_path $name) | cut -c 2-) |
94 |
fi |
95 |
|
96 |
if [ "$uploaded_temp_files" = "yes" ]; then |
97 |
# Remove leading / |
98 |
tempdir=$(echo $(get_tmp_path $name) | cut -c 2-) |
99 |
uploaded_temp_files_dir="$tempdir/koha_${name}_upload" |
100 |
fi |
101 |
|
89 |
tar -czf "$metadump" -C / $excludes \ |
102 |
tar -czf "$metadump" -C / $excludes \ |
90 |
"etc/koha/sites/$name" \ |
103 |
"etc/koha/sites/$name" \ |
91 |
"etc/apache2/sites-available/$instancefile" \ |
104 |
"etc/apache2/sites-available/$instancefile" \ |
92 |
"etc/apache2/sites-enabled/$instancefile" \ |
105 |
"etc/apache2/sites-enabled/$instancefile" \ |
93 |
"var/lib/koha/$name" \ |
106 |
"var/lib/koha/$name" \ |
94 |
"var/log/koha/$name" |
107 |
"var/log/koha/$name" \ |
|
|
108 |
$uploaded_files_dir \ |
109 |
$uploaded_temp_files_dir |
110 |
|
95 |
|
111 |
|
96 |
[ "$quiet" = "no" ] && echo "Done." |
112 |
[ "$quiet" = "no" ] && echo "Done." |
97 |
} |
113 |
} |
Lines 106-111
while [ $# -gt 0 ]; do
Link Here
|
106 |
--exclude-indexes) |
122 |
--exclude-indexes) |
107 |
exclude_indexes="yes" |
123 |
exclude_indexes="yes" |
108 |
shift ;; |
124 |
shift ;; |
|
|
125 |
--uploaded_files) |
126 |
uploaded_files="yes" |
127 |
shift ;; |
128 |
--uploaded_temp_files) |
129 |
uploaded_temp_files="yes" |
130 |
shift ;; |
109 |
-h|--help) |
131 |
-h|--help) |
110 |
usage ; exit 0 ;; |
132 |
usage ; exit 0 ;; |
111 |
-q|--quiet) |
133 |
-q|--quiet) |