}
/*
- *
+ * Send a include list with a plugin and listing=<path> parameter
+ */
+bool send_ls_plugin_fileset(JCR *jcr, const char *plugin, const char *path)
+{
+ BSOCK *fd = jcr->file_bsock;
+ fd->fsend(filesetcmd, "" /* no vss */, "" /* no snapshot */);
+
+ fd->fsend("I\n");
+ fd->fsend("O h\n"); /* is it required? */
+ fd->fsend("N\n");
+ fd->fsend("P %s listing=%s\n", plugin, path);
+ fd->fsend("N\n");
+ fd->signal(BNET_EOD); /* end of data */
+
+ if (!response(jcr, fd, OKinc, "Include", DISPLAY_ERROR)) {
+ return false;
+ }
+ return true;
+}
+
+/*
* Send a include list with only one directory and recurse=no
- * TODO: Need to display the plugin somewhere
- * The main point is that we don't introduce any protocol change
*/
bool send_ls_fileset(JCR *jcr, const char *path)
{
extern int connect_to_file_daemon(JCR *jcr, int retry_interval,
int max_retry_time, int verbose);
extern bool send_ls_fileset(JCR *jcr, const char *path);
+extern bool send_ls_plugin_fileset(JCR *jcr, const char *plugin, const char *path);
extern bool send_include_list(JCR *jcr);
extern bool send_exclude_list(JCR *jcr);
extern bool send_level_command(JCR *jcr);
POOL_MEM buf;
CLIENT *client = NULL;
char *path = NULL;
+ char *plugin = NULL;
JCR *jcr = ua->jcr;
int i;
return false;
}
+ /* optional plugin=... parameter */
+ i = find_arg_with_value(ua, NT_("plugin"));
+ if (i > 0) {
+ plugin = ua->argv[i];
+ }
+
jcr->client = client;
jcr->setJobType(JT_BACKUP);
return false;
}
- if (!send_ls_fileset(jcr, path)) {
- ua->error_msg(_("Failed to send command to Client.\n"));
- goto bail_out;
+ /* when .ls plugin prepare a special ls_plugin_fileset */
+ if (plugin){
+ if (!send_ls_plugin_fileset(jcr, plugin, path)) {
+ ua->error_msg(_("Failed to send plugin command to Client.\n"));
+ goto bail_out;
+ }
+ } else {
+ if (!send_ls_fileset(jcr, path)) {
+ ua->error_msg(_("Failed to send command to Client.\n"));
+ goto bail_out;
+ }
}
jcr->file_bsock->fsend("estimate listing=%d\n", 1);