|
Lines 47-52
$scriptname -h|--help
Link Here
|
| 47 |
--quiet|-q Make the script avoid printing to STDOUT |
47 |
--quiet|-q Make the script avoid printing to STDOUT |
| 48 |
(useful for calling from another scripts). |
48 |
(useful for calling from another scripts). |
| 49 |
--help|-h Display this help message |
49 |
--help|-h Display this help message |
|
|
50 |
--without-db-name Do not include database name |
| 50 |
|
51 |
|
| 51 |
EOF |
52 |
EOF |
| 52 |
} |
53 |
} |
|
Lines 69-75
dump_instance()
Link Here
|
| 69 |
[ -z "$backupdir" ] && backupdir="/var/spool/koha/$name" |
70 |
[ -z "$backupdir" ] && backupdir="/var/spool/koha/$name" |
| 70 |
dbdump="$backupdir/$name-$date.sql.gz" |
71 |
dbdump="$backupdir/$name-$date.sql.gz" |
| 71 |
[ "$quiet" = "no" ] && echo "* DB to $dbdump" |
72 |
[ "$quiet" = "no" ] && echo "* DB to $dbdump" |
| 72 |
mysqldump --databases --host="$mysqlhost" \ |
73 |
dbflag="--databases" |
|
|
74 |
[ "$without_db_name" = "yes" ] && dbflag="" |
| 75 |
mysqldump $dbflag --host="$mysqlhost" \ |
| 73 |
--user="$mysqluser" --password="$mysqlpass" "$mysqldb" | |
76 |
--user="$mysqluser" --password="$mysqlpass" "$mysqldb" | |
| 74 |
gzip > "$dbdump" |
77 |
gzip > "$dbdump" |
| 75 |
chown "root:$name-koha" "$dbdump" |
78 |
chown "root:$name-koha" "$dbdump" |
|
Lines 99-104
dump_instance()
Link Here
|
| 99 |
# Default values |
102 |
# Default values |
| 100 |
quiet="no" |
103 |
quiet="no" |
| 101 |
exclude_indexes="no" |
104 |
exclude_indexes="no" |
|
|
105 |
without_db_name="no" |
| 102 |
|
106 |
|
| 103 |
while [ $# -gt 0 ]; do |
107 |
while [ $# -gt 0 ]; do |
| 104 |
|
108 |
|
|
Lines 106-111
while [ $# -gt 0 ]; do
Link Here
|
| 106 |
--exclude-indexes) |
110 |
--exclude-indexes) |
| 107 |
exclude_indexes="yes" |
111 |
exclude_indexes="yes" |
| 108 |
shift ;; |
112 |
shift ;; |
|
|
113 |
--without-db-name) |
| 114 |
without_db_name="yes" |
| 115 |
shift ;; |
| 109 |
-h|--help) |
116 |
-h|--help) |
| 110 |
usage ; exit 0 ;; |
117 |
usage ; exit 0 ;; |
| 111 |
-q|--quiet) |
118 |
-q|--quiet) |
| 112 |
- |
|
|