many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
{ NT_("list"), list_cmd, _("list [pools | jobs | jobtotals | media <pool=pool-name> | files <jobid=nn>]; from catalog")},
{ NT_("label"), label_cmd, _("label a tape")},
{ NT_("llist"), llist_cmd, _("full or long list like list command")},
- { NT_("memory"), memory_cmd, _("print current memory usage")},
{ NT_("messages"), messagescmd, _("messages")},
+ { NT_("memory"), memory_cmd, _("print current memory usage")},
{ NT_("mount"), mount_cmd, _("mount <storage-name>")},
{ NT_("prune"), prunecmd, _("prune expired records from catalog")},
{ NT_("purge"), purgecmd, _("purge records from catalog")},
if (do_prompt(ua, _("Job"), _("Choose Job to cancel"), buf, sizeof(buf)) < 0) {
return 1;
}
- if (njobs == 1) {
- if (!get_yesno(ua, _("Confirm cancel (yes/no): ")) || ua->pint32_val == 0) {
+ if (ua->api && njobs == 1) {
+ char nbuf[1000];
+ bsnprintf(nbuf, sizeof(nbuf), _("Cancel: %s\n\n%s"), buf,
+ _("Confirm cancel?"));
+ if (!get_yesno(ua, nbuf) || ua->pint32_val == 0) {
return 1;
}
+ } else {
+ if (njobs == 1) {
+ if (!get_yesno(ua, _("Confirm cancel (yes/no): ")) || ua->pint32_val == 0) {
+ return 1;
+ }
+ }
}
sscanf(buf, "JobId=%d Job=%127s", &njobs, JobName);
jcr = get_jcr_by_full_name(JobName);
static int delete_volume(UAContext *ua)
{
MEDIA_DBR mr;
+ char buf[1000];
if (!select_media_dbr(ua, &mr)) {
return 1;
"and all Jobs saved on that volume from the Catalog\n"),
mr.VolumeName);
- if (!get_yesno(ua, _("Are you sure you want to delete this Volume? (yes/no): "))) {
+ bsnprintf(buf, sizeof(buf), _("Are you sure you want to delete Volume \"%s\"? (yes/no): "),
+ mr.VolumeName);
+ if (!get_yesno(ua, buf)) {
return 1;
}
if (ua->pint32_val) {
static int delete_pool(UAContext *ua)
{
POOL_DBR pr;
+ char buf[200];
memset(&pr, 0, sizeof(pr));
if (!get_pool_dbr(ua, &pr)) {
return 1;
}
- if (!get_yesno(ua, _("Are you sure you want to delete this Pool? (yes/no): "))) {
+ bsnprintf(buf, sizeof(buf), _("Are you sure you want to delete Pool \"%s\"? (yes/no): "),
+ pr.Name);
+ if (!get_yesno(ua, buf)) {
return 1;
}
if (ua->pint32_val) {
int memory_cmd(UAContext *ua, const char *cmd)
{
list_dir_status_header(ua);
- sm_dump(false);
+ sm_dump(false, true);
return 1;
}
Dmsg2(120, "%s: %s\n", command, ua->UA_sock->msg);
store.store = get_storage_resource(ua, true/*arg is storage*/);
- pm_strcpy(store.store_source, _("unknown source"));
if (!store.store) {
return;
}
+ pm_strcpy(store.store_source, _("unknown source"));
set_wstorage(jcr, &store);
drive = get_storage_drive(ua, store.store);
if (strcmp(command, "mount") == 0) {
return 1;
}
+#if 1
static int version_cmd(UAContext *ua, const char *cmd)
{
ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE,
HOST_OS, DISTNAME, DISTVER);
return 1;
}
+#else
+/*
+ * Test code -- turned on only for debug testing
+ */
+static int version_cmd(UAContext *ua, const char *cmd)
+{
+ dbid_list ids;
+ POOL_MEM query(PM_MESSAGE);
+ open_db(ua);
+ Mmsg(query, "select MediaId from Media,Pool where Pool.PoolId=Media.PoolId and Pool.Name='Full'");
+ db_get_query_dbids(ua->jcr, ua->db, query, ids);
+ ua->send_msg("num_ids=%d max_ids=%d tot_ids=%d\n", ids.num_ids, ids.max_ids, ids.tot_ids);
+ for (int i=0; i < ids.num_ids; i++) {
+ ua->send_msg("id=%d\n", ids.DBId[i]);
+ }
+ close_db(ua);
+ return 1;
+}
+#endif
/*
* This call explicitly checks for a catalog=xxx and