Skip to content

Commit

Permalink
Properly specify rsync --exclude directories
Browse files Browse the repository at this point in the history
Using '--exclude=dirname/*' to explicitly specify directories whose contents
should not be copied. This will result in empty directories being created
on the destination if they exist on the source, but that's not a problem as
they are needed anyway.

Previously the generated rsync command contained '--exclude=pg_log*', which
will break replication on 9.5 as the wildcard expansion prevents the
'pg_logical' directory from being copied.
  • Loading branch information
ibarwick committed Jul 7, 2014
1 parent 54e62c3 commit e40b9db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion repmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,7 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
if (is_directory)
{
strcat(rsync_flags,
" --exclude=pg_xlog* --exclude=pg_log* --exclude=pg_control --exclude=*.pid");
" --exclude=pg_xlog/* --exclude=pg_log/* --exclude=pg_control --exclude=*.pid");
maxlen_snprintf(script, "rsync %s %s:%s/* %s",
rsync_flags, host_string, remote_path, local_path);
}
Expand Down

0 comments on commit e40b9db

Please sign in to comment.