Thread: pg_basebackup not completing

pg_basebackup not completing

From
Somnath Som
Date:

DB Size 114GB, when running to pg_basebackup then its stuck in 99%, full backup is not completing.

Postgres Version: 12.16

 

Backup Script: pg_basebackup -h $PGHOST -p $PGPORT -U $PGUSER -D $BACKUP_DIR/pgbase_$(date "+%d.%m.%Y-%H%M%S") -Ft -z -Xs -P >> $LOG_FILE 2>&1

 

 

 

Attachment

Re: pg_basebackup not completing

From
obi reddy
Date:

Hi somnath,

Are you getting any error?

Thanks
Obireddy

On Wed, 24 Jul 2024, 11:25 Somnath Som, <somnath.som@ericsson.com> wrote:

DB Size 114GB, when running to pg_basebackup then its stuck in 99%, full backup is not completing.

Postgres Version: 12.16

 

Backup Script: pg_basebackup -h $PGHOST -p $PGPORT -U $PGUSER -D $BACKUP_DIR/pgbase_$(date "+%d.%m.%Y-%H%M%S") -Ft -z -Xs -P >> $LOG_FILE 2>&1

 

 

 

Attachment

Re: pg_basebackup not completing

From
Laurenz Albe
Date:
On Wed, 2024-07-24 at 05:55 +0000, Somnath Som wrote:
> DB Size 114GB, when running to pg_basebackup then its stuck in 99%, full backup is not completing.
> Postgres Version: 12.16
>  
> Backup Script: pg_basebackup -h $PGHOST -p $PGPORT -U $PGUSER -D $BACKUP_DIR/pgbase_$(date "+%d.%m.%Y-%H%M%S") -Ft -z
-Xs-P >> $LOG_FILE 2>&1 
>  
> [image showing pg_basebackup at 99%, immediately followed by a shell prompt]

The image looks like pg_basebackup completed successfully.
Perhaps the display didn't count up to 100.

There is no error message and no sign that the command was
interrupted.  Look at the return code right after the command:

  echo $?

If that is 0, you can be sure that the backup was successful.

Yours,
Laurenz Albe



Re: pg_basebackup not completing

From
Ron Johnson
Date:
On Wed, Jul 24, 2024 at 1:55 AM Somnath Som <somnath.som@ericsson.com> wrote:

DB Size 114GB, when running to pg_basebackup then its stuck in 99%, full backup is not completing.

Postgres Version: 12.16

 

Backup Script: pg_basebackup -h $PGHOST -p $PGPORT -U $PGUSER -D $BACKUP_DIR/pgbase_$(date "+%d.%m.%Y-%H%M%S") -Ft -z -Xs -P >> $LOG_FILE 2>&1

 

 

 
Following up on Laurenz's post: always check return codes.
My scripts, for example, are peppered with:
declare -i RC
pg_blah ....
RC=$? ; if (( $RC != 0 )); then date +"%F %T Blah failed with error code=$RC. Exiting script."; exit 6; fi

Attachment