summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorVenky Shankar <venky@gluster.com>2011-10-24 15:29:00 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-04 02:06:44 -0700
commit8e171a03d81452a2998b01997da7647c0b3bf52b (patch)
tree54117831ec7c55fe0b1bb67f9ec227c5fe2059c6 /cli
parentcc0a908bc5d5046bcb2909fc98765038f15e918d (diff)
cli: add geo-replication log-rotate command
Rotating geo-replication master/monitor log files from cli. On invocation, the log file for a given master-slave session is backed up with the current timestamp suffixed to the file name and signal is sent to gsyncd to start logging to a new log file. Sample commands: * Rotate log file for this <master>:<slave> session: gluster volume geo-replication <master> <slave> log-rotate * Rotate log files for all session for master volume <master> gluster volume geo-replication <master> log-rotate * Rotate log files for all sessions: gluster volume geo-replication log-rotate Change-Id: If801743e9f37bd282e68d262203141626ce77e55 BUG: 3519 Reviewed-on: http://review.gluster.com/653 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@gluster.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c6
-rw-r--r--cli/src/cli-cmd-volume.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 00cba5782a7..4b749f8cd55 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1160,6 +1160,7 @@ cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **options)
* volume geo-replication [$m [$s]] status
* volume geo-replication [$m] $s config [[!]$opt [$val]]
* volume geo-replication $m $s start|stop
+ * volume geo-replication $m [$s] log-rotate
*/
if (wordcount < 3)
@@ -1219,6 +1220,11 @@ cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **options)
if (!masteri || !slavei)
goto out;
+ } else if (strcmp(words[cmdi], "log-rotate") == 0) {
+ type = GF_GSYNC_OPTION_TYPE_ROTATE;
+
+ if (slavei && !masteri)
+ goto out;
} else
goto out;
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 151c5cb8201..60618db092a 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1245,7 +1245,7 @@ struct cli_cmd volume_cmds[] = {
"reset all the reconfigured options"},
#if (SYNCDAEMON_COMPILE)
- {"volume "GEOREP" [<VOLNAME>] [<SLAVE-URL>] {start|stop|config|status} [options...]",
+ {"volume "GEOREP" [<VOLNAME>] [<SLAVE-URL>] {start|stop|config|status|log-rotate} [options...]",
cli_cmd_volume_gsync_set_cbk,
"Geo-sync operations",
cli_cmd_check_gsync_exists_cbk},