public inbox for [email protected]  
help / color / mirror / Atom feed
From: Stephen Frost <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: pgbackrest creating new directories (messing up cron jobs).
Date: Tue, 10 Mar 2020 20:37:27 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <f15eb088fd457eb9c42c03f5d8628baa.squirrel@danielas3rtn54uwmofdo3x2bsdifr47huasnmbgqzfrec5ubupvtpid.onion>
References: <5808963daa5dd7b4a3704bba8dac828b.squirrel@danielas3rtn54uwmofdo3x2bsdifr47huasnmbgqzfrec5ubupvtpid.onion>
	<[email protected]>
	<c13c5fb8c0b95a9bb68f7ecefb829c7f.squirrel@danielas3rtn54uwmofdo3x2bsdifr47huasnmbgqzfrec5ubupvtpid.onion>
	<[email protected]>
	<f15eb088fd457eb9c42c03f5d8628baa.squirrel@danielas3rtn54uwmofdo3x2bsdifr47huasnmbgqzfrec5ubupvtpid.onion>

Greetings,

* [email protected] ([email protected]) wrote:
> I think I need to take a step backwards and ask something else before
> moving forward.

Good idea.

> > Isn't that going to mail you the same WAL over and over again if you set
> > it up as a cronjob..?  Is that really what you want?
> 
> I took a full backup when I started. Then I used type=diff. This creates
> two archives every x hours (depending on the time period set in cron).

WAL files are not "archives" in the sense that they are a complete
database backup- they're just the write-ahead-logs from the ongoing
running of PG.  You need the actual data files as well as the WAL to
perform a restore.

> For example:
> 
> -rw-r----- 1 postgres postgres 27145 Mar 11 00:00
> 0000000100000001000000B9-6f3902fe5c3bdebc3c1c124ec6821c7206e350da.gz
> 
> -rw-r----- 1 postgres postgres 27126 Mar 11 00:00
> 0000000100000001000000BA-214e7142c6eda0a350577f6bd624c3db203e184f.gz
> 
> Only one of these relates to the database I setup in PostgreSQL. I don't
> know what the other one is but it might be related to the "default"
> database 'postgres'. (This is just a guess).

No, that's not how WAL works.  Those are two WAL files and they're both
generated as part of running the PG system- they are not specific to one
database or another in PG.

> Irrespective, I would only want a new archive file if something has
> changed in the database. Yet I seem to always receive two new files every
> x hours even if nothing has changed.

These individuals files are not archives of the entire PG system or
anything you can use to reconstruct a running PG system with just one
file.

> So I tried type-incr but that seems to produce the same results as type=diff.

The difference between incremental and differential backups is
documented at https://pgbackrest.org

> I wonder what I am doing wrong?

I'm afraid there are some pretty fundamental misunderstandings that you
have about the PG WAL, PG backups, and what you can do with a PG cluster
andf file-level backup/restore.

Documentation about the WAL can be found here:

https://www.postgresql.org/docs/current/wal-intro.html

If what you're actually looking for is a single file that has a backup
of your entire database, you can get that by running:

pgbackrest backup --archive-copy

and then do:

pgbackrest restore --pg-path=/path/to/somewhere
tar -czf pgdata.tar.gz /path/to/somewhere

or so.  Check the pgbackrest docs for the specific command syntax and
such.

Thanks,

Stephen


Attachments:

  [application/pgp-signature] signature.asc (819B, ../[email protected]/2-signature.asc)
  download

view thread (6+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: pgbackrest creating new directories (messing up cron jobs).
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox