Skip to content
Snippets Groups Projects
Commit bd6aaf21 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'update-localdump-to-classlike-functions' into 'master'

update __DB__ prefix

See merge request !49
parents 73c081c9 1eda3641
No related branches found
No related tags found
1 merge request!49update __DB__ prefix
......@@ -98,7 +98,8 @@
else
cecho error "ERROR occured while dumping - no gzip"
fi
echo -n "__DB__$SERVICENAME INFO: backup to " ls -l "$_outfile"* 2>&1
# echo -n "__DB__$SERVICENAME INFO: backup to "
# ls -l "$_outfile"* 2>&1
echo
}
......
......@@ -158,7 +158,7 @@ function mysql.backup(){
for _dbname in $( mysql.db.list )
do
echo -n "__DB__${SERVICENAME} $_dbname backup "
echo -n "__DB__${SERVICENAME} backup $_dbname "
_outfile="${BACKUP_TARGETDIR}/$(get_outfile ${_dbname}).sql"
mysql.db.dump "$_dbname" "$_outfile"
......
......@@ -54,7 +54,7 @@ function doPgsqlBackup(){
sSqlGetDblist="select datname from pg_database where not datistemplate and datallowconn order by datname;"
for DATABASE in $(su ${PGUSER} -c "psql -At -c '$sSqlGetDblist' postgres" 2>/dev/null)
do
echo -n "__DB__${SERVICENAME} $_dbname backup "
echo -n "__DB__${SERVICENAME} backup $_dbname "
OUTFILE="${BACKUP_TARGETDIR}/$(get_outfile ${DATABASE}).sql"
su ${PGUSER} -c "pg_dump -Fp ${DATABASE} >$OUTFILE"
fetchrc
......
......@@ -36,24 +36,24 @@ function doSqliteBackup(){
for DATABASE_FILE in $(_j_getvar ${FILEDEFS} "sqlite")
do
echo -n "__DB__${SERVICENAME} $_dbname backup "
echo -n "__DB__${SERVICENAME} backup $DATABASE_FILE "
if [ ! -f "$DATABASE_FILE" ]; then
color error
echo "ERROR: given database file does not exist: $DATABASE_FILE"
echo "ERROR: given database file does not exist"
color reset
rc=$rc+1
else
file "$DATABASE_FILE" | cut -f 2 -d ":" | grep -i "sqlite" >/dev/null
if [ $? -ne 0 ]; then
color error
echo "ERROR: given database file is not a sqlite database $DATABASE_FILE"
echo "ERROR: given database file is not a sqlite database"
color reset
rc=$rc+1
else
TARGET=$(get_outfile ${DATABASE_FILE})
TARGET=${BACKUP_TARGETDIR}/$(echo ${TARGET} | sed "s#/#_#g").sql
META=${TARGET}.gz.meta
echo target: $TARGET
echo -n " to $TARGET "
sqlite3 "$DATABASE_FILE" .dump >"${TARGET}"
fetchrc
db._compressDumpfile "${TARGET}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment