From: Eric Bollengier Date: Fri, 30 Oct 2009 20:52:11 +0000 (+0100) Subject: Add .actiononpurge command X-Git-Tag: Release-5.0.0~281^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=730033d0e792e8edab6746fddfbee42b1a2345ba;p=bacula%2Fbacula Add .actiononpurge command Tweak help output --- diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index 3c4e808d3b..05892a718a 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -603,7 +603,8 @@ static struct cpl_keywords_t cpl_keywords[] = { {"schedule=", ".schedule" }, {"volume=", ".media" }, {"oldvolume=", ".media" }, - {"volstatus=", ".volstatus" } + {"volstatus=", ".volstatus" }, + {"actiononpurge=", ".actiononpurge" } }; #define key_size ((int)(sizeof(cpl_keywords)/sizeof(struct cpl_keywords_t))) @@ -621,8 +622,9 @@ static char **readline_completion(const char *text, int start, int end) matches = (char **)NULL; /* If this word is at the start of the line, then it is a command - to complete. Otherwise it is the name of a file in the current - directory. */ + * to complete. Otherwise it is the name of a file in the current + * directory. + */ s = get_previous_keyword(start, 0); cmd = get_first_keyword(); if (s) { diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 99cc12509d..0961a3d452 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -132,9 +132,9 @@ static struct cmdstruct commands[] = { /* C { NT_("exit"), quit_cmd, _("Terminate Bconsole session"), NT_(""), false}, { NT_("gui"), gui_cmd, _("Non-interactive gui mode"), NT_("on | off"), false}, { NT_("help"), help_cmd, _("Print help on specific command"), - NT_("add autodisplay automount cancel create delete disable enable estimate exit gui label list llist messages " - "memory mount prune purge python quit query restore relabel release reload run status setdebug setip show " - "sqlquery time trace unmount umount update use var version wait"), false}, + NT_("add autodisplay automount cancel create delete disable\n\tenable estimate exit gui label list llist" + "\n\tmessages memory mount prune purge python quit query\n\trestore relabel release reload run status" + "\n\tsetdebug setip show sqlquery time trace unmount umount\n\tupdate use var version wait"), false}, { NT_("label"), label_cmd, _("Label a tape"), NT_("storage= volume= pool="), false}, { NT_("list"), list_cmd, _("List objects from catalog"), @@ -156,7 +156,8 @@ static struct cmdstruct commands[] = { /* C { NT_("quit"), quit_cmd, _("Terminate Bconsole session"), NT_(""), false}, { NT_("query"), querycmd, _("Query catalog"), NT_(""), false}, { NT_("restore"), restore_cmd, _("Restore files"), - NT_("where= client= storage= bootstrap= jobid= done select all"), false}, + NT_("where= client= storage= bootstrap=" + "\n\tjobid= done select all"), false}, { NT_("relabel"), relabel_cmd, _("Relabel a tape"), NT_("storage= oldvolume= volume="), false}, @@ -164,8 +165,8 @@ static struct cmdstruct commands[] = { /* C { NT_("release"), release_cmd, _("Release storage"), NT_("storage-name"), false}, { NT_("reload"), reload_cmd, _("Reload conf file"), NT_(""), true}, { NT_("run"), run_cmd, _("Run a job"), - NT_("job= client= fileset= level= storage= where= " - "when= yes"), false}, /* need to be check */ + NT_("job= client=\n\tfileset= level=\n\tstorage=" + "where=\n\twhen=\n\tyes"), false}, /* need to be check */ { NT_("status"), status_cmd, _("Report status"), NT_("all | dir= | director | client= | storage= slots | days=nnn"), true}, @@ -187,8 +188,11 @@ static struct cmdstruct commands[] = { /* C NT_("storage= [ drive= ] | jobid= | job="), false}, { NT_("update"), update_cmd, _("Update volume, pool or stats"), - NT_("pool= | slots storage= scan| stats | volume= volstatus= volretention= " - "pool= recycle= slot= inchanger="),true}, + NT_("stats\n\tpool=\n\tslots storage= scan" + "\n\tvolume= volstatus= volretention=" + "\n\t pool= recycle= slot=\n\t inchanger=" + "\n\t maxvolbytes= maxvolfiles= maxvoljobs=" + "\n\t enable= recyclepool= actiononpurge="),true}, { NT_("use"), use_cmd, _("Use catalog xxx"), NT_(""), false}, { NT_("var"), var_cmd, _("Does variable expansion"), NT_(""), false}, { NT_("version"), version_cmd, _("Print Director version"), NT_(""), true}, @@ -1876,12 +1880,12 @@ int wait_cmd(UAContext *ua, const char *cmd) static int help_cmd(UAContext *ua, const char *cmd) { int i; - ua->send_msg(_(" Command Description\n ======= ===========\n")); for (i=0; iargc == 2) { if (!strcasecmp(ua->argk[1], commands[i].key)) { - ua->send_msg(_(" %-13s %s\n %s\n"), commands[i].key, commands[i].help, commands[i].usage); + ua->send_msg(_(" %-13s %s\n\nArguments:\n\t%s\n"), commands[i].key, + commands[i].help, commands[i].usage); break; } } else { diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index fd2dfdef28..ef777e2078 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -69,6 +69,7 @@ static bool volstatuscmd(UAContext *ua, const char *cmd); static bool mediatypescmd(UAContext *ua, const char *cmd); static bool locationscmd(UAContext *ua, const char *cmd); static bool mediacmd(UAContext *ua, const char *cmd); +static bool aopcmd(UAContext *ua, const char *cmd); static bool dot_bvfs_lsdirs(UAContext *ua, const char *cmd); static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd); @@ -102,6 +103,7 @@ static struct cmdstruct commands[] = { /* help */ /* can be used in runscript * { NT_(".media"), mediacmd, NULL, true}, { NT_(".mediatypes"), mediatypescmd, NULL, true}, { NT_(".locations"), locationscmd, NULL, true}, + { NT_(".actiononpurge"),aopcmd, NULL, true}, { NT_(".bvfs_lsdirs"), dot_bvfs_lsdirs, NULL, true}, { NT_(".bvfs_lsfiles"),dot_bvfs_lsfiles,NULL, true}, { NT_(".bvfs_update"), dot_bvfs_update, NULL, true}, @@ -585,6 +587,12 @@ static bool storagecmd(UAContext *ua, const char *cmd) return true; } +static bool aopcmd(UAContext *ua, const char *cmd) +{ + ua->send_msg("None\n"); + ua->send_msg("Truncate\n"); + return true; +} static bool typescmd(UAContext *ua, const char *cmd) { @@ -596,7 +604,6 @@ static bool typescmd(UAContext *ua, const char *cmd) return true; } - /* * If this command is called, it tells the director that we * are a program that wants a sort of API, and hence,