kiorky / db_smart_backup

Another database(db) smart backup tool (mysql/postgresql/slapd/mongo/es/redis)
http://www.makina-corpus.com
Other
28 stars 7 forks source link

pg_dump problems on RHEL6.4 #1

Closed regilero closed 8 years ago

regilero commented 10 years ago

Report:

[db_smart_backup] ======================================================================
[db_smart_backup] DB_SMART_BACKUP by kiorky@cryptelium.net / http://www.makina-corpus.com
[db_smart_backup] Conf: '/root/db_smart_backup.conf'
[db_smart_backup] Log: '/var/db_smart_backup/logs/db_smart_backup_2014-03-19_18-07-21.183083727.log'
[db_smart_backup] Backup Start Time: 2014-03-19 18:07:21.324285312
[db_smart_backup] Backup of database compression://type@server: bzip2://postgresql@localhost
[db_smart_backup] ======================================================================
[db_smart_backup] ======================================================================
[db_smart_backup] GLOBAL BACKUP
[db_smart_backup] ======================================================================
[db_smart_backup] Dumping database to maybe uncompressed dump: /var/backup/postgresql/localhost/__GLOBAL__/dumps/__GLOBAL___2014-03-19_18-07-21.sql
./db_smart_backup.sh: line 328:  : commande introuvable
[db_smart_backup]  bzip2 -> /var/backup/postgresql/localhost/__GLOBAL__/dumps/__GLOBAL___2014-03-19_18-07-21.sql.bz2 ( 0  / 0.00 )
[db_smart_backup] ======================================================================
[db_smart_backup] DATABASES BACKUP
[db_smart_backup] ======================================================================
[db_smart_backup] Dumping database all to maybe uncompressed dump: /var/backup/postgresql/localhost/all/dumps/all_2014-03-19_18-07-21.sql
pg_dump: [programme d'archivage (db)] la connexion à la base de données « all » a échoué : FATAL:  database "all" does not exist
[db_smart_backup]     Backup of all failed !!!
[db_smart_backup] ======================================================================
[db_smart_backup] Execute backup rotation policy, keep
[db_smart_backup]    -  logs           : 60
[db_smart_backup]    -  last snapshots : 24
[db_smart_backup]    -  daily dumps    : 14
[db_smart_backup]    -  weekly dumpss  : 8
[db_smart_backup]    -  monthly dumps  : 12
[db_smart_backup]    - Operating in: '/var/backup/logs'
[db_smart_backup]    - Operating in: '/var/backup/postgresql/localhost/all'
[db_smart_backup]    - Operating in: '/var/backup/postgresql/localhost/__GLOBAL__'
[db_smart_backup] ======================================================================
[db_smart_backup] Cleaning orphaned dumps:
[db_smart_backup]        * Pruning /var/backup/postgresql/localhost/all/dumps/all_2014-03-19_18-07-21.sql
[db_smart_backup] ======================================================================
[db_smart_backup] Total disk space used for backup storage..
[db_smart_backup]   Size   - Location:
[db_smart_backup]     24K    /var/backup/postgresql/localhost/all
[db_smart_backup]     24K    /var/backup/postgresql/localhost/__GLOBAL__
[db_smart_backup]     48K    total
[db_smart_backup] ======================================================================
[db_smart_backup] Backup end time: 2014-03-19 18:07:22.035809314
[db_smart_backup] ======================================================================

Conf:

COMP=bzip2
RUNAS=postgres
DBUSER=postgres
BACKUP_TYPE=postgresql
TOP_BACKUPDIR="/var/backup"
DO_GLOBAL_BACKUP="1"
KEEP_LASTS=24
KEEP_DAYS=14
KEEP_WEEKS=8
KEEP_MONTHES=12
KEEP_LOGS=60
DPERM="750"
FPERM="640"
OWNER=root
GROUP=root
PSQL="/usr/bin/psql"
PG_DUMP="/usr/bin/pg_dump"
PG_DUMPALL="/usr/bin/pg_dumpall"
OPT="--create -Fc"
OPTALL="--globals-only"

We also made a fix on the scripot to get it running (maybe coming from there), we commented the verufy_backup_type which reported always "ABRUPT PROGRAM TERMINATION: Please provide a postgresql_dump export function"

verify_backup_type() {
    echo "ok"
    # for typ_ in _dump _dumpall;do
    #     if [ x"$(fn_exists ${BACKUP_TYPE}${typ_})" != "x0" ];then
    #         die "Please provide a ${BACKUP_TYPE}${typ_} export function"
    #     fi
    # done
}