On Mon, Feb 22, 2021 at 07:36:28AM +0000, PG Doc comments form wrote: > I've been trying out saving and restoring compressed archive logs. The > restore_command stated in the docs at "25.3.6.2. Compressed Archive Logs" > ('gunzip < /mnt/server/archivedir/%f > %p') did not work for me, because the > archive_command ('gzip < %p > /var/lib/pgsql/archive/%f') alters the > filename to %f.gz
On which platform please? Using a pipe with gzip does not alter the output file name where the data is pushed to. > I had to change the restore_command to 'gunzip < > /mnt/server/archivedir/%f.gz > %p'. Now, I kind of agree that compressing a file and not using a proper .gz extension for its name can be confusing. So what about the attached to tweak both archive_command and restore_command in this section of the docs? -- Michael
diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 3c8aaed0b6..089102a599 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1520,11 +1520,11 @@ tar -rf /var/lib/pgsql/backup.tar /var/lib/pgsql/archive/ If archive storage size is a concern, you can use <application>gzip</application> to compress the archive files: <programlisting> -archive_command = 'gzip < %p > /var/lib/pgsql/archive/%f' +archive_command = 'gzip < %p > /var/lib/pgsql/archive/%f.gz' </programlisting> You will then need to use <application>gunzip</application> during recovery: <programlisting> -restore_command = 'gunzip < /mnt/server/archivedir/%f > %p' +restore_command = 'gunzip < /mnt/server/archivedir/%f.gz > %p' </programlisting> </para> </sect3>
signature.asc
Description: PGP signature