pg_basebackup Restore problem

Started by Johnathan Tiamohabout 2 years ago11 messagesgeneral
Jump to latest
#1Johnathan Tiamoh
johnathantiamoh@gmail.com

Hello,

I am trying to restore a pg_basebackup and have the following errors.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive
tar: /tnt/backup/current/7401.tar.gz: Not found in archive
tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied
PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

Thank you
Johnathan T.

#2Ron
ronljohnsonjr@gmail.com
In reply to: Johnathan Tiamoh (#1)
Re: pg_basebackup Restore problem

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <johnathantiamoh@gmail.com>
wrote:

Hello,

I am trying to restore a pg_basebackup and have the following errors.

You need to tell us the PG version number *and* show us the full command
you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#3Johnathan Tiamoh
johnathantiamoh@gmail.com
In reply to: Ron (#2)
Re: pg_basebackup Restore problem

You need to tell us the PG version number *and* show us the full command
you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

Show quoted text

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following errors.

You need to tell us the PG version number *and* show us the full command
you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#4Ron
ronljohnsonjr@gmail.com
In reply to: Johnathan Tiamoh (#3)
Re: pg_basebackup Restore problem

1. What's in $PATH_FOLDER?
2. What pg_basebackup command did you use?
3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:27 AM Johnathan Tiamoh <johnathantiamoh@gmail.com>
wrote:

Show quoted text

You need to tell us the PG version number *and* show us the full command
you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following errors.

You need to tell us the PG version number *and* show us the full command
you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#5Johnathan Tiamoh
johnathantiamoh@gmail.com
In reply to: Ron (#4)
Re: pg_basebackup Restore problem

1. What's in $PATH_FOLDER?

/tnt/backup/current

2. What pg_basebackup command did you use?

pg_basebackup -D "$baseback_dir" --format=tar \
"${comp_opts[@]}" --wal-method=stream --no-password
--verbose "${PG_DUMP_OPTS[@]}"

/bin/mv "$baseback_dir"/* "/enf/backup/current/"
/bin/rm -r "$baseback_dir"

3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:46 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

Show quoted text

1. What's in $PATH_FOLDER?
2. What pg_basebackup command did you use?
3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:27 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

You need to tell us the PG version number *and* show us the full command
you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following errors.

You need to tell us the PG version number *and* show us the full
command you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#6Ron
ronljohnsonjr@gmail.com
In reply to: Johnathan Tiamoh (#5)
Re: pg_basebackup Restore problem

Wait a minute... *tar* is throwing the errors, not pg_basebackup, no?

On Wed, Jan 17, 2024 at 3:27 PM Johnathan Tiamoh <johnathantiamoh@gmail.com>
wrote:

Show quoted text

1. What's in $PATH_FOLDER?

/tnt/backup/current

2. What pg_basebackup command did you use?

pg_basebackup -D "$baseback_dir" --format=tar \
"${comp_opts[@]}" --wal-method=stream --no-password
--verbose "${PG_DUMP_OPTS[@]}"

/bin/mv "$baseback_dir"/* "/enf/backup/current/"
/bin/rm -r "$baseback_dir"

3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:46 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

1. What's in $PATH_FOLDER?
2. What pg_basebackup command did you use?
3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:27 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

You need to tell us the PG version number *and* show us the full
command you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following errors.

You need to tell us the PG version number *and* show us the full
command you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#7Johnathan Tiamoh
johnathantiamoh@gmail.com
In reply to: Ron (#6)
Re: pg_basebackup Restore problem

Yes.

I am trying to restore the backups on a standby

On Wed, Jan 17, 2024 at 4:04 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:

Show quoted text

Wait a minute... *tar* is throwing the errors, not pg_basebackup, no?

On Wed, Jan 17, 2024 at 3:27 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

1. What's in $PATH_FOLDER?

/tnt/backup/current

2. What pg_basebackup command did you use?

pg_basebackup -D "$baseback_dir" --format=tar \
"${comp_opts[@]}" --wal-method=stream --no-password
--verbose "${PG_DUMP_OPTS[@]}"

/bin/mv "$baseback_dir"/* "/enf/backup/current/"
/bin/rm -r "$baseback_dir"

3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:46 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

1. What's in $PATH_FOLDER?
2. What pg_basebackup command did you use?
3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:27 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

You need to tell us the PG version number *and* show us the full
command you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following errors.

You need to tell us the PG version number *and* show us the full
command you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#8Ron
ronljohnsonjr@gmail.com
In reply to: Johnathan Tiamoh (#7)
Re: pg_basebackup Restore problem

Then you've got a bug somewhere in:
tar -h -zxvf $PATH_FOLDER/* .tar.gz
ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

On Wed, Jan 17, 2024 at 4:07 PM Johnathan Tiamoh <johnathantiamoh@gmail.com>
wrote:

Show quoted text

Yes.

I am trying to restore the backups on a standby

On Wed, Jan 17, 2024 at 4:04 PM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

Wait a minute... *tar* is throwing the errors, not pg_basebackup, no?

On Wed, Jan 17, 2024 at 3:27 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

1. What's in $PATH_FOLDER?

/tnt/backup/current

2. What pg_basebackup command did you use?

pg_basebackup -D "$baseback_dir" --format=tar \
"${comp_opts[@]}" --wal-method=stream --no-password
--verbose "${PG_DUMP_OPTS[@]}"

/bin/mv "$baseback_dir"/* "/enf/backup/current/"
/bin/rm -r "$baseback_dir"

3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:46 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

1. What's in $PATH_FOLDER?
2. What pg_basebackup command did you use?
3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:27 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

You need to tell us the PG version number *and* show us the full
command you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following errors.

You need to tell us the PG version number *and* show us the full
command you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#9Johnathan Tiamoh
johnathantiamoh@gmail.com
In reply to: Ron (#8)
Re: pg_basebackup Restore problem

Ok.

I'm a little confused because has always work

On Wed, Jan 17, 2024 at 4:11 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:

Show quoted text

Then you've got a bug somewhere in:
tar -h -zxvf $PATH_FOLDER/* .tar.gz
ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

On Wed, Jan 17, 2024 at 4:07 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Yes.

I am trying to restore the backups on a standby

On Wed, Jan 17, 2024 at 4:04 PM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

Wait a minute... *tar* is throwing the errors, not pg_basebackup, no?

On Wed, Jan 17, 2024 at 3:27 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

1. What's in $PATH_FOLDER?

/tnt/backup/current

2. What pg_basebackup command did you use?

pg_basebackup -D "$baseback_dir" --format=tar \
"${comp_opts[@]}" --wal-method=stream --no-password
--verbose "${PG_DUMP_OPTS[@]}"

/bin/mv "$baseback_dir"/* "/enf/backup/current/"
/bin/rm -r "$baseback_dir"

3. Why aren't you letting pg_basebackup maintain the WAL files it needs?

On Wed, Jan 17, 2024 at 11:46 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

1. What's in $PATH_FOLDER?
2. What pg_basebackup command did you use?
3. Why aren't you letting pg_basebackup maintain the WAL files it
needs?

On Wed, Jan 17, 2024 at 11:27 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

You need to tell us the PG version number *and* show us the full
command you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following
errors.

You need to tell us the PG version number *and* show us the full
command you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#10Ron
ronljohnsonjr@gmail.com
In reply to: Johnathan Tiamoh (#9)
Re: pg_basebackup Restore problem

Perfectly understandable, but tar *did* fail. Time to start debugging your
shell script.

On Wed, Jan 17, 2024 at 4:26 PM Johnathan Tiamoh <johnathantiamoh@gmail.com>
wrote:

Show quoted text

Ok.

I'm a little confused because has always work

On Wed, Jan 17, 2024 at 4:11 PM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

Then you've got a bug somewhere in:
tar -h -zxvf $PATH_FOLDER/* .tar.gz
ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

On Wed, Jan 17, 2024 at 4:07 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Yes.

I am trying to restore the backups on a standby

On Wed, Jan 17, 2024 at 4:04 PM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

Wait a minute... *tar* is throwing the errors, not pg_basebackup, no?

On Wed, Jan 17, 2024 at 3:27 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

1. What's in $PATH_FOLDER?

/tnt/backup/current

2. What pg_basebackup command did you use?

pg_basebackup -D "$baseback_dir" --format=tar \
"${comp_opts[@]}" --wal-method=stream --no-password
--verbose "${PG_DUMP_OPTS[@]}"

/bin/mv "$baseback_dir"/* "/enf/backup/current/"
/bin/rm -r "$baseback_dir"

3. Why aren't you letting pg_basebackup maintain the WAL files it
needs?

On Wed, Jan 17, 2024 at 11:46 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

1. What's in $PATH_FOLDER?
2. What pg_basebackup command did you use?
3. Why aren't you letting pg_basebackup maintain the WAL files it
needs?

On Wed, Jan 17, 2024 at 11:27 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

You need to tell us the PG version number *and* show us the full
command you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <
ronljohnsonjr@gmail.com> wrote:

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following
errors.

You need to tell us the PG version number *and* show us the full
command you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or
directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?

#11Johnathan Tiamoh
johnathantiamoh@gmail.com
In reply to: Ron (#10)
Re: pg_basebackup Restore problem

Thank You very much for your time.

On Wed, Jan 17, 2024 at 4:51 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:

Show quoted text

Perfectly understandable, but tar *did* fail. Time to start debugging
your shell script.

On Wed, Jan 17, 2024 at 4:26 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Ok.

I'm a little confused because has always work

On Wed, Jan 17, 2024 at 4:11 PM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

Then you've got a bug somewhere in:
tar -h -zxvf $PATH_FOLDER/* .tar.gz
ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

On Wed, Jan 17, 2024 at 4:07 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Yes.

I am trying to restore the backups on a standby

On Wed, Jan 17, 2024 at 4:04 PM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

Wait a minute... *tar* is throwing the errors, not pg_basebackup, no?

On Wed, Jan 17, 2024 at 3:27 PM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

1. What's in $PATH_FOLDER?

/tnt/backup/current

2. What pg_basebackup command did you use?

pg_basebackup -D "$baseback_dir" --format=tar \
"${comp_opts[@]}" --wal-method=stream --no-password
--verbose "${PG_DUMP_OPTS[@]}"

/bin/mv "$baseback_dir"/* "/enf/backup/current/"
/bin/rm -r "$baseback_dir"

3. Why aren't you letting pg_basebackup maintain the WAL files it
needs?

On Wed, Jan 17, 2024 at 11:46 AM Ron Johnson <ronljohnsonjr@gmail.com>
wrote:

1. What's in $PATH_FOLDER?
2. What pg_basebackup command did you use?
3. Why aren't you letting pg_basebackup maintain the WAL files it
needs?

On Wed, Jan 17, 2024 at 11:27 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

You need to tell us the PG version number *and* show us the full
command you ran. ?

Postgresql Version 14.10

tar -h -zxvf $PATH_FOLDER/* .tar.gz

ls $PATH_FOLDER/*.tar.gz | xargs -I {} tar -h -zxvf {}

What user are you running pg_basebackup as?

I ran it as postgres and now I'm restoring as postgres

/tnt??? Or /mnt?
/tnt/backup/current

This is where the backup files are.

On Wed, Jan 17, 2024 at 11:15 AM Ron Johnson <
ronljohnsonjr@gmail.com> wrote:

On Wed, Jan 17, 2024 at 11:11 AM Johnathan Tiamoh <
johnathantiamoh@gmail.com> wrote:

Hello,

I am trying to restore a pg_basebackup and have the following
errors.

You need to tell us the PG version number *and* show us the full
command you ran.

nohup: ignoring input
tar: /tnt/backup/current/7400.tar.gz: Not found in archive

tar: /tnt/backup/current/7401.tar.gz: Not found in archive

tar: /tnt/backup/current/7402.tar.gz: Not found in archive
tar: /tnt/backup/current/base.tar.gz: Not found in archive
tar: /tnt/backup/current/pg_wal.tar.gz: Not found in archive
tar: Exiting with failure status due to previous errors
PG_14_202107181/
tar: PG_14_202107181: Cannot mkdir: Permission denied

What user are you running pg_basebackup as?

PG_14_202107181/137502/
tar: PG_14_202107181: Cannot mkdir: Permission denied
tar: PG_14_202107181/137502: Cannot mkdir: No such file or
directory
PG_14_202107181/137502/3222926016
tar: PG_14_202107181: Cannot mkdir: Permission denied

The files exist in the specified directory.

/tnt??? Or /mnt?