Hello.I just started using Duplicati (2.0.3.3_beta_2018-04-02) earlier this week on a Mac (OS version 10.12.6).
I created and successfully ran a backup to an SFTP destination. I can use the web interface and the restore function to browse through the backup and find and restore the files I’m looking for.
Now here’s the main question: I’m looking for a way to search for a specific character string across ALL of the backups. How do I do that?
–
Going through the forum, it looks like I should be able to through the command line, but I haven’t been able to make it work.
Here’s the syntax I used:
/Applications/Duplicati.app/Contents/MacOS/duplicati-cli find sftp://“location of the backup” “the fully resolved path of the file”
(where the fully resolved path is /Users/name/Folder/file.docx)
Result:
When I enter the command, it asks me for the encryption passphrase, which I enter and it accepts.
Then I can see the mono-sgen64 process running at 100%. I’ve let it run for upto 30 minutes, but it doesn’t return a result.
When the fully qualified path and the exact filename is specified, shouldn’t it return the result right away?
Am I doing something wrong or there something else I’m missing or the CLI isn’t working correctly?
You can do this by invoking the commandine tool from the GUI.
Click the backup job name to open its details and click Commandline.
Select the Find command from the drop-down menu.
Delete everything from the Commandline arguments text box and replace it with a search filter, for example *testfile* will find C:\Folder\Testfile.txt and D:\Folder\Subfolder\This is another testfile from me.docx`.
On the next line in the same text box, type --all-versions. Alternatively, you can select all-versions from the Advanced options list at the bottom of the page and click to select the checkbox.
Click the Run “find” command now button at the bottom of the page.
Are you looking for the specific character string in the file names or the file contents?
My original question was to search for a specific string in the file names.
If you know how to search the contents as well, that would be useful.
When you say “across ALL backups” do you mean across all versions of a particular backup job or across multiple backup jobs?
I meant across all versions of a single backup job.
I’m using a Mac. I followed the steps you outlined, but it doesn’t work. (I tried with and without the --allversions with the same results)
Here’s a couple of screen shots. I’m looking for a file called Gartner Reprint.pdf.
The first screen is from the standard search function.
The second shows the commandline search as you described.
And the third shows the top portion of the results which is none found.
Does it have something to do with it running on Mac?
Am I doing something wrong or missing something obvious?
I don’t see this option anywhere in your screenshots. What is the exact syntax you used? The correct command line option is --all-versions, NOT --allversions.
Remember to put --all-versions on a new line if you type it into the Commandline arguments text box.
Hello @kees-z.
The images I posted did not include the --all-versions option. With those I simply wanted to test if it worked without searching all versions of a single backup set.
I ran the same command again with the --all-versions options and got another error.
In the commandline I entered Gartner*, then on a new line entered --all-versions
Here are the screen captures of the command and then results. Still getting an error and I’m not sure if it’s a bug or maybe my unfamiliarity with Duplicati. Thanks again for your assistance.
@kees-z I got it to work. I had to change a couple of things.
On the commandline window, I had to leave the original directory path and append the search string to it.
I had to delete (by clicking the x) the compression-module, default-filters, disable-module and exclude-files-attributes options and then run the find.
Along the same lines, now that I can find the files, is there a way to restore all of the versions in a single command (instead of each version individually)?