#!/bin/bash NUCLOS_LIB=/Library/Nuclos NUCLOS_BACKUP=$NUCLOS_LIB/backup NUCLOS_DATA=$NUCLOS_LIB/home/data PGLOGIN=$NUCLOS_BACKUP/.postgresql PGDUMP=/Library/PostgreSQL/9.3/bin/pg_dump PGUSER=`head -1 $PGLOGIN | awk '{ print $1 }'` PGPASSWORD=`head -1 $PGLOGIN | awk '{ print $2 }'` export PGPASSWORD $PGDUMP --host localhost --port 5432 --username "$PGUSER" --format custom --encoding UTF8 --file "$NUCLOS_BACKUP/postgresql_trozo.backup" --schema "nuclos" "nuclosdb" --no-password tar -zcf "$NUCLOS_BACKUP/documents_trozo.tar.gz" -C "$NUCLOS_DATA/„ documents