Thread: backup file system
Hi : I am very new in postgres and hope someone can give me some suggestions I am working on a shell script to backup my postgres database. Compared with pg_dump and pg_dumpall, I would like to backup the file system instead of dump the database because I can shutdown the database server in midnight for a few hours. I also can sure I will have a stable backup. ( No user is doing anything at the same time ) I search internet but did not find anyone mention this method. Did I miss anything? I plan to backup all files under data directory. Is that enough? thanks Fushan DBA
On 30 Oct 2001 at 15:27, Leong, Fushan wrote: > I am working on a shell script to backup my postgres database. Compared > with pg_dump and pg_dumpall, I would like to backup the file system > instead of dump the database because I can shutdown the database server > in midnight for a few hours. I also can sure I will have a stable backup. > ( No user is doing anything at the same time ) Personally, I'd rather use pg_dump. That way I'm guaranteed to have a file which will work with a future version of PostgreSQL. Why do you want to back up the file system instead of using pg_dump? SIDE ISSUE: A possible benefit of using pg_dump instead of backing up the file system: all parts of the database are excerised/explored; any bad parts of the file system will be identified then. -- Dan Langille The FreeBSD Diary - http://freebsddiary.org/ - practical examples
I had the same problem, but backing up the filesystem isn't the solution. I did it and when I tried to restore the database was impossible. If anyone knows how to solve this problem please let me know "Leong, Fushan" wrote: > Hi : > > I am very new in postgres and hope someone can give me some suggestions > > I am working on a shell script to backup my postgres database. Compared > with pg_dump and pg_dumpall, I would > like to backup the file system instead of dump the database because I can > shutdown the database server in > midnight for a few hours. I also can sure I will have a stable backup. ( No > user is doing anything at the same time ) > > I search internet but did not find anyone mention this method. Did I miss > anything? I plan to backup all > files under data directory. Is that enough? > > thanks > Fushan > DBA > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html
Attachment
I don't understand why it's not possible to backup all the database files while the db is down. I'm working for years with Oracle and doing a tape backup from all necessary files is one way to restore the database. Egon Francisco Solari wrote: > I had the same problem, but backing up the filesystem isn't the solution. I did > it and when I tried to restore the database was impossible. If anyone knows how > to solve this problem please let me know > > "Leong, Fushan" wrote: > > > Hi : > > > > I am very new in postgres and hope someone can give me some suggestions > > > > I am working on a shell script to backup my postgres database. Compared > > with pg_dump and pg_dumpall, I would > > like to backup the file system instead of dump the database because I can > > shutdown the database server in > > midnight for a few hours. I also can sure I will have a stable backup. ( No > > user is doing anything at the same time ) > > > > I search internet but did not find anyone mention this method. Did I miss > > anything? I plan to backup all > > files under data directory. Is that enough? > > > > thanks > > Fushan > > DBA > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 5: Have you checked our extensive FAQ? > > > > http://www.postgresql.org/users-lounge/docs/faq.html > > ------------------------------------------------------------------------ > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster
Francisco : Would you tell me what problem did you face when you try to restore the database from backup filesystem? Fushan -----Original Message----- From: Francisco Solari [mailto:fsolari@prosalud.com.ar] Sent: Wednesday, October 31, 2001 5:41 AM To: Leong, Fushan Cc: 'pgsql-admin@postgresql.org' Subject: Re: [ADMIN] backup file system I had the same problem, but backing up the filesystem isn't the solution. I did it and when I tried to restore the database was impossible. If anyone knows how to solve this problem please let me know "Leong, Fushan" wrote: > Hi : > > I am very new in postgres and hope someone can give me some suggestions > > I am working on a shell script to backup my postgres database. Compared > with pg_dump and pg_dumpall, I would > like to backup the file system instead of dump the database because I can > shutdown the database server in > midnight for a few hours. I also can sure I will have a stable backup. ( No > user is doing anything at the same time ) > > I search internet but did not find anyone mention this method. Did I miss > anything? I plan to backup all > files under data directory. Is that enough? > > thanks > Fushan > DBA > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html
Or, you can backup both... We backup the filesystem every night with plain old dump and then run pg_dump and copy that file onto the backup, too. Makes for some nice redundancy. --Jeremy On Tuesday, October 30, 2001, at 04:05 PM, Dan Langille wrote: > On 30 Oct 2001 at 15:27, Leong, Fushan wrote: > >> I am working on a shell script to backup my postgres database. >> Compared >> with pg_dump and pg_dumpall, I would like to backup the file system >> instead of dump the database because I can shutdown the database >> server >> in midnight for a few hours. I also can sure I will have a stable >> backup. >> ( No user is doing anything at the same time ) > > Personally, I'd rather use pg_dump. That way I'm guaranteed to have a > file which will work with a future version of PostgreSQL. > > Why do you want to back up the file system instead of using pg_dump? > > SIDE ISSUE: A possible benefit of using pg_dump instead of backing up > the > file system: all parts of the database are excerised/explored; any bad > parts of the file system will > be identified then. > -- > Dan Langille > The FreeBSD Diary - http://freebsddiary.org/ - practical examples > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >
>> Why do you want to back up the file system instead of using pg_dump? There is some discussion of this issue in the PG documentation; see http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/backup-file.html regards, tom lane