mdb->db_name, /* database name */
mdb->db_port, /* default port */
mdb->db_socket, /* default = socket */
- 0); /* flags = none */
+ CLIENT_FOUND_ROWS); /* flags */
/* If no connect, try once more incase it is a timing problem */
if (mdb->db == NULL) {
char ed1[30];
m_msg(file, line, &mdb->errmsg, _("Insertion problem: affected_rows=%s\n"),
edit_uint64(mdb->num_rows, ed1));
+ if (verbose) {
+ j_msg(file, line, jcr, M_INFO, 0, "%s\n", cmd);
+ }
return 0;
}
mdb->changes++;
mdb->num_rows = sql_affected_rows(mdb);
if (mdb->num_rows != 1) {
char ed1[30];
- m_msg(file, line, &mdb->errmsg, _("Update problem: affect_rows=%s\n"),
+ m_msg(file, line, &mdb->errmsg, _("Update problem: affected_rows=%s\n"),
edit_uint64(mdb->num_rows, ed1));
+ if (verbose) {
+ j_msg(file, line, jcr, M_INFO, 0, "%s\n", cmd);
+ }
return 0;
}
mdb->changes++;
tmr.VolumeName);
continue;
}
- bstrncpy(mr->VolumeName, tmr.VolumeName, sizeof(mr->VolumeName));
+ bstrncpy(mr->VolumeName, name, sizeof(mr->VolumeName));
+ bstrncat(mr->VolumeName, num, sizeof(mr->VolumeName));
+ break; /* Got good name */
}
if (mr->VolumeName[0] == 0) {
Jmsg(jcr, M_ERROR, 0, _("Too many failures. Giving up creating Volume.\n"));
if (db_create_media_record(jcr, jcr->db, mr) &&
db_update_pool_record(jcr, jcr->db, &pr)) {
db_unlock(jcr->db);
+ Jmsg(jcr, M_INFO, 0, _("Created new Volume \"%s\" in catalog.\n"), mr->VolumeName);
Dmsg1(90, "Created new Volume=%s\n", mr->VolumeName);
return 1;
} else {
/* Imported functions */
extern int statuscmd(UAContext *ua, char *cmd);
extern int listcmd(UAContext *ua, char *cmd);
+extern int llistcmd(UAContext *ua, char *cmd);
extern int showcmd(UAContext *ua, char *cmd);
extern int messagescmd(UAContext *ua, char *cmd);
extern int autodisplaycmd(UAContext *ua, char *cmd);
static int usecmd(UAContext *ua, char *cmd), unmountcmd(UAContext *ua, char *cmd);
static int labelcmd(UAContext *ua, char *cmd), mountcmd(UAContext *ua, char *cmd), updatecmd(UAContext *ua, char *cmd);
static int versioncmd(UAContext *ua, char *cmd), automountcmd(UAContext *ua, char *cmd);
+static int timecmd(UAContext *ua, char *cmd);
static int update_volume(UAContext *ua);
static int update_pool(UAContext *ua);
static int delete_volume(UAContext *ua);
{ N_("help"), helpcmd, _("print this command")},
{ N_("label"), labelcmd, _("label a tape")},
{ N_("list"), listcmd, _("list [pools | jobs | jobtotals | media <pool> | files job=<nn>]; from catalog")},
+ { N_("llist"), llistcmd, _("full or long list like list command")},
{ N_("messages"), messagescmd, _("messages")},
{ N_("mount"), mountcmd, _("mount <storage-name>")},
{ N_("restore"), restorecmd, _("restore files")},
{ N_("version"), versioncmd, _("print Director version")},
{ N_("quit"), quitcmd, _("quit")},
{ N_("query"), querycmd, _("query catalog")},
+ { N_("time"), timecmd, _("print current time")},
{ N_("exit"), quitcmd, _("exit = quit")},
};
#define comsize (sizeof(commands)/sizeof(struct cmdstruct))
return 1;
}
+/*
+ * print time
+ */
+static int timecmd(UAContext *ua, char *cmd)
+{
+ char sdt[50];
+ time_t ttime = time(NULL);
+ struct tm tm;
+ localtime_r(&ttime, &tm);
+ strftime(sdt, sizeof(sdt), "%d-%b-%Y %H:%M:%S", &tm);
+ bsendmsg(ua, "%s\n", sdt);
+ return 1;
+}
+
/*
/* Imported functions */
/* Forward referenced functions */
+static int do_listcmd(UAContext *ua, char *cmd, int llist);
/*
* list clients - list clients
*
*/
-int listcmd(UAContext *ua, char *cmd)
+
+/* Do long or full listing */
+int llistcmd(UAContext *ua, char *cmd)
+{
+ return do_listcmd(ua, cmd, 1);
+}
+
+/* Do short or summary listing */
+int listcmd(UAContext *ua, char *cmd)
+{
+ return do_listcmd(ua, cmd, 0);
+}
+
+static int do_listcmd(UAContext *ua, char *cmd, int llist)
{
POOLMEM *VolumeName;
int jobid, n;
term_msg = _("*** Backup Error ***");
break;
case JS_Cancelled:
- term_msg = _("Backup Cancelled");
+ term_msg = _("Backup Canceled");
break;
default:
term_msg = term_code;
if (!dir_get_volume_info(jcr, 1)) {
Mmsg(&jcr->errmsg, _("Wanted Volume \"%s\".\n"
" Actual Volume \"%s\" not acceptable because:\n"
- " %s\n"),
+ " %s"),
dev->VolCatInfo.VolCatName, dev->VolHdr.VolName,
jcr->dir_bsock->msg);
/* Restore desired volume name, note device info out of sync */
Dmsg0(100, "!write_vol_label\n");
goto mount_next_vol;
}
- Jmsg(jcr, M_INFO, 0, _("Created Volume label %s on device %s.\n"),
+ Jmsg(jcr, M_INFO, 0, _("Labeled new Volume \"%s\" on device %s.\n"),
jcr->VolumeName, dev_name(dev));
goto read_volume; /* read label we just wrote */
}
Dmsg0(200, "dir_update_vol_info. Set Append\n");
dir_update_volume_info(jcr, &dev->VolCatInfo, 1); /* indicate doing relabel */
if (recycle) {
- Jmsg(jcr, M_INFO, 0, _("Recycled volume %s on device %s, all previous data lost.\n"),
+ Jmsg(jcr, M_INFO, 0, _("Recycled volume \"%s\" on device %s, all previous data lost.\n"),
jcr->VolumeName, dev_name(dev));
} else {
- Jmsg(jcr, M_INFO, 0, _("Wrote label to prelabeled Volume %s on device %s\n"),
+ Jmsg(jcr, M_INFO, 0, _("Wrote label to prelabeled Volume \"%s\" on device %s\n"),
jcr->VolumeName, dev_name(dev));
}
* just now putting it into append mode.
*/
Dmsg0(200, "Device previously written, moving to end of data\n");
- Jmsg(jcr, M_INFO, 0, _("Volume %s previously written, moving to end of data.\n"),
+ Jmsg(jcr, M_INFO, 0, _("Volume \"%s\" previously written, moving to end of data.\n"),
jcr->VolumeName);
if (!eod_dev(dev)) {
Jmsg(jcr, M_ERROR, 0, _("Unable to position to end of data %s. ERR=%s\n"),
dev_name(dev), strerror_dev(dev));
- Jmsg(jcr, M_INFO, 0, _("Marking Volume %s in Error in Catalog.\n"),
+ Jmsg(jcr, M_INFO, 0, _("Marking Volume \"%s\" in Error in Catalog.\n"),
jcr->VolumeName);
strcpy(dev->VolCatInfo.VolCatStatus, "Error");
Dmsg0(200, "dir_update_vol_info. Set Error.\n");
/* */
#define VERSION "1.30"
#define VSTRING "1"
-#define BDATE "28 March 2003"
-#define LSMDATE "28Mar03"
+#define BDATE "02 April 2003"
+#define LSMDATE "02Apr03"
/* Debug flags */
#define DEBUG 1