rsync: exclude log/pg_log directory depending on PostgreSQL version

This is more for completeness as the data source here is Barman, which
shouldn't contain log files anyway.
This commit is contained in:
Ian Barwick
2020-09-04 15:03:27 +09:00
parent 3945314e65
commit 4c3aed2573

View File

@@ -3130,16 +3130,16 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
if (server_version_num >= 100000)
{
appendPQExpBufferStr(&rsync_flags,
" --exclude=pg_wal/*");
" --exclude=pg_wal/* --exclude=log/*");
}
else
{
appendPQExpBufferStr(&rsync_flags,
" --exclude=pg_xlog/*");
" --exclude=pg_xlog/* --exclude=pg_log/*");
}
appendPQExpBufferStr(&rsync_flags,
" --exclude=pg_log/* --exclude=pg_stat_tmp/*");
" --exclude=pg_stat_tmp/*");
maxlen_snprintf(script, "rsync %s %s:%s/* %s",
rsync_flags.data, host_string, remote_path, local_path);