Tuesday, April 21, 2009

Free Dragonball Episodes In Hindi

On syntax in Vim on Debian

It think I have just decided to update my
Postgresql 8.3 on my development server. But before switching to the 8.2 to 8.3 I want to backup all my databases. As an operation that I decided I quite regularly write a small script as follows: # / bin / bash # # Script: DBBAckup.sh Allow to backup a database postgresql
USE = "
Usage:` basename $ 0 `dbnametobackup [postgresql_server (by default = localhost)]
" CGDATE =` date-I `
if [$ #-lt 2]; Then if [$ #-lt 1]; Then
echo" $ USAGE "exit 1 else

DBName = $ 1

DbServer = 'localhost'
fi else
fi BackupPath=" DBBackup_${DBName}_${CGDATE}_Compressed.backup " echo "
****Started backup of db $DBName at `date`, log of operation is in $BackupPath.log
"
if pg_dump --ignore-version --verbose --format=c --oids -h $DBServer -p 5432 -U postgres -f $BackupPath -n public $DBName > $BackupPath.log 2>&1 ; then
echo "BACKUP OKAY"
pg_restore -l $BackupPath > "DBBackup_${DBName}_${CGDATE}_tablelist.txt"
else
           echo "PROBLEM OCCURED --> see log in  $BackupPath.log" 
if [ -f $BackupPath ] ; then
if! [-f $ BackupPath] Then
rm-f $ BackupPath

fi fi fi



echo "**** Finished sync of db $ DBName at `date` "


then a line is saves all the local bases except the 2 templates that are useless to me:
for i in `psql-U postgres-l you can find a brief guide to new FireFox 3 in French
which is a translation of the English article "A Field Guide to
FireFox 3
" by Debra Lyn Richardson




0 comments:

Post a Comment