mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
made rsync_options configurable
This commit is contained in:
3
config.c
3
config.c
@@ -39,6 +39,7 @@ parse_config(const char *config_file, repmgr_config *config)
|
|||||||
memset(config->cluster_name, 0, sizeof(config->cluster_name));
|
memset(config->cluster_name, 0, sizeof(config->cluster_name));
|
||||||
config->node = -1;
|
config->node = -1;
|
||||||
memset(config->conninfo, 0, sizeof(config->conninfo));
|
memset(config->conninfo, 0, sizeof(config->conninfo));
|
||||||
|
memset(config->rsync_options, 0, sizeof(config->rsync_options));
|
||||||
|
|
||||||
/* Read next line */
|
/* Read next line */
|
||||||
while ((s = fgets (buff, sizeof buff, fp)) != NULL)
|
while ((s = fgets (buff, sizeof buff, fp)) != NULL)
|
||||||
@@ -57,6 +58,8 @@ parse_config(const char *config_file, repmgr_config *config)
|
|||||||
config->node = atoi(value);
|
config->node = atoi(value);
|
||||||
else if (strcmp(name, "conninfo") == 0)
|
else if (strcmp(name, "conninfo") == 0)
|
||||||
strncpy (config->conninfo, value, MAXLEN);
|
strncpy (config->conninfo, value, MAXLEN);
|
||||||
|
else if (strcmp(name, "rsync_options") == 0)
|
||||||
|
strncpy (config->rsync_options, value, QUERY_STR_LEN);
|
||||||
else
|
else
|
||||||
printf ("WARNING: %s/%s: Unknown name/value pair!\n", name, value);
|
printf ("WARNING: %s/%s: Unknown name/value pair!\n", name, value);
|
||||||
}
|
}
|
||||||
|
|||||||
1
config.h
1
config.h
@@ -22,6 +22,7 @@ typedef struct
|
|||||||
char cluster_name[MAXLEN];
|
char cluster_name[MAXLEN];
|
||||||
int node;
|
int node;
|
||||||
char conninfo[MAXLEN];
|
char conninfo[MAXLEN];
|
||||||
|
char rsync_options[QUERY_STR_LEN];
|
||||||
} repmgr_config;
|
} repmgr_config;
|
||||||
|
|
||||||
void parse_config(const char *config_file, repmgr_config *config);
|
void parse_config(const char *config_file, repmgr_config *config);
|
||||||
|
|||||||
6
repmgr.c
6
repmgr.c
@@ -1237,7 +1237,11 @@ copy_remote_files(char *host, char *remote_user, char *remote_path, char *local_
|
|||||||
char host_string[QUERY_STR_LEN];
|
char host_string[QUERY_STR_LEN];
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
sprintf(options, "--archive --checksum --compress --progress --rsh=ssh");
|
if (strnlen(config.rsync_options, QUERY_STR_LEN) == 0)
|
||||||
|
sprintf(options, "--archive --checksum --compress --progress --rsh=ssh");
|
||||||
|
else
|
||||||
|
strncpy(options, config.rsync_options, QUERY_STR_LEN);
|
||||||
|
|
||||||
if (force)
|
if (force)
|
||||||
strcat(options, " --delete");
|
strcat(options, " --delete");
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
cluster=test
|
cluster=test
|
||||||
node=2
|
node=2
|
||||||
conninfo='host=192.168.204.104'
|
conninfo='host=192.168.204.104'
|
||||||
|
rsync_options=--archive --checksum --compress --progress --rsh=ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user