return stat;
}
-/* TODO: See if we want to let the FD do all kind
- * of catalog request/update
- */
void catalog_request(JCR *jcr, BSOCK *bs)
{
MEDIA_DBR mr, sdmr;
catalog_request(jcr, bs);
continue;
}
+ /* Only the Snapshot commands are authorized for the FD */
+ if (role==BSOCK_TYPE_FD && bs->msg[0] == 'C') {
+ snapshot_catreq(jcr, bs);
+ continue;
+ }
if (role==BSOCK_TYPE_SD && bs->msg[0] == 'U') { /* SD sending attributes */
Dmsg2(900, "Catalog upd jcr=%p: %s", jcr, bs->msg);
catalog_update(jcr, bs);
/* Ask client to create/prune/delete a snapshot via the command line */
int snapshot_cmd(UAContext *ua, const char *cmd)
{
+ if (!open_client_db(ua)) {
+ Dmsg0(10, "Unable to open database\n");
+ return 0;
+ }
+
SNAPSHOT_DBR snapdbr;
for (int i=0; i<ua->argc; i++) {
if (strcasecmp(ua->argk[i], NT_("purge")) == 0) {