|
Lines 75-81
dump_instance()
Link Here
|
| 75 |
mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )" |
75 |
mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )" |
| 76 |
backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' $kohaconfig || true )" |
76 |
backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' $kohaconfig || true )" |
| 77 |
[ -z "$backupdir" ] && backupdir="/var/spool/koha/$name" |
77 |
[ -z "$backupdir" ] && backupdir="/var/spool/koha/$name" |
| 78 |
dbdump="$backupdir/$name-$date.sql.gz" |
78 |
dbdump="$backupdir/$name-$date.sql.zst" |
| 79 |
dbflag="--databases" |
79 |
dbflag="--databases" |
| 80 |
[ "$without_db_name" = "yes" ] && dbflag="" |
80 |
[ "$without_db_name" = "yes" ] && dbflag="" |
| 81 |
if [ "$schema_only" = "yes" ] |
81 |
if [ "$schema_only" = "yes" ] |
|
Lines 90-103
dump_instance()
Link Here
|
| 90 |
[ "$quiet" = "no" ] && echo "* DB to $dbdump" |
90 |
[ "$quiet" = "no" ] && echo "* DB to $dbdump" |
| 91 |
mysqldump $dbflag --host="$mysqlhost" --single-transaction \ |
91 |
mysqldump $dbflag --host="$mysqlhost" --single-transaction \ |
| 92 |
--user="$mysqluser" --password="$mysqlpass" "$mysqldb" | |
92 |
--user="$mysqluser" --password="$mysqlpass" "$mysqldb" | |
| 93 |
gzip > "$dbdump" |
93 |
zstd > "$dbdump" |
| 94 |
chown "root:$name-koha" "$dbdump" |
94 |
chown "root:$name-koha" "$dbdump" |
| 95 |
chmod g+r "$dbdump" |
95 |
chmod g+r "$dbdump" |
| 96 |
|
96 |
|
| 97 |
instancefile="$name.conf" |
97 |
instancefile="$name.conf" |
| 98 |
|
98 |
|
| 99 |
# Dump configs, logs, etc. |
99 |
# Dump configs, logs, etc. |
| 100 |
metadump="$backupdir/$name-$date.tar.gz" |
100 |
metadump="$backupdir/$name-$date.tar.zst" |
| 101 |
output="* configs, logs" |
101 |
output="* configs, logs" |
| 102 |
|
102 |
|
| 103 |
if [ "$exclude_indexes" = "yes" ]; then |
103 |
if [ "$exclude_indexes" = "yes" ]; then |
|
Lines 129-135
dump_instance()
Link Here
|
| 129 |
set +e |
129 |
set +e |
| 130 |
|
130 |
|
| 131 |
if [ "$exclude_logs" = "yes" ]; then |
131 |
if [ "$exclude_logs" = "yes" ]; then |
| 132 |
tar -czf "$metadump" -C / $excludes \ |
132 |
tar -caf "$metadump" -C / $excludes \ |
| 133 |
"etc/koha/sites/$name" \ |
133 |
"etc/koha/sites/$name" \ |
| 134 |
"etc/apache2/sites-available/$instancefile" \ |
134 |
"etc/apache2/sites-available/$instancefile" \ |
| 135 |
"etc/apache2/sites-enabled/$instancefile" \ |
135 |
"etc/apache2/sites-enabled/$instancefile" \ |
|
Lines 137-143
dump_instance()
Link Here
|
| 137 |
$uploaded_files_dir \ |
137 |
$uploaded_files_dir \ |
| 138 |
$uploaded_temp_files_dir |
138 |
$uploaded_temp_files_dir |
| 139 |
else |
139 |
else |
| 140 |
tar -czf "$metadump" -C / $excludes \ |
140 |
tar -caf "$metadump" -C / $excludes \ |
| 141 |
"etc/koha/sites/$name" \ |
141 |
"etc/koha/sites/$name" \ |
| 142 |
"etc/apache2/sites-available/$instancefile" \ |
142 |
"etc/apache2/sites-available/$instancefile" \ |
| 143 |
"etc/apache2/sites-enabled/$instancefile" \ |
143 |
"etc/apache2/sites-enabled/$instancefile" \ |