#!/bin/sh #----------------------------------------------------------------------------- # /var/install/bin/postgresql-tools-listbackups # # Copyright (c) 2005 Daniel Vogel # # Creation: 07.06.2006 dv # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #----------------------------------------------------------------------------- #include eislib . /var/install/include/eislib . /etc/config.d/postgresql PROG=/usr/local/pgsql/bin/pg_restore clrhome # Mount backup media if [ ! -z "$POSTGRESQL_BACKUP_MOUNT" ] then eval ${POSTGRESQL_BACKUP_MOUNT} 2>&1 if [ "$?" != "0" ] then echo "unable to execute: $POSTGRESQL_BACKUP_MOUNT" anykey exit 1 fi fi # list backup files mecho -info "List of backup files:" backup_files=`/bin/ls -t "$POSTGRESQL_BACKUP_TARGET/"*.backup 2>/dev/null` c="1" for file in $backup_files do mecho -info -n "$c " mecho "$file" c=`/usr/bin/expr $c + 1` done # Unount backup media if [ ! -z "$POSTGRESQL_BACKUP_UMOUNT" ] then eval ${POSTGRESQL_BACKUP_UMOUNT} 2>&1 if [ "$?" != "0" ] then echo "unable to execute: $POSTGRESQL_BACKUP_UMOUNT" fi fi anykey exit 0