Extract a Folder from Duplicity Archive
Solution 1
That's correct, even if it tells "--file-to-restore", you can enter any file or folder path (without the "/" sign at the beginning of it, for example "temp/logs") at "foldername" and any "destination folder" (with the "/"sign at the beginning of it, for example "/temp/logs") to the command.
Sample: I want to restore my /temp/logs which is backed-up 3 days ago into the same folder:
duplicity -t 3D --file-to-restore temp/logs file:///backup/location /temp/logs
Sample2: I want to restore my file /temp/logs/app-error.log which is backed-up 3 days ago into the same folder:
duplicity -t 3D --file-to-restore temp/logs/app-error.log file:///backup/location /temp/logs/app-error.log
Note that you have to give a full destination path for the file.
Sample3: My backup stays at an ftp server=my.ftp.server with user=root at the location=my_backup, the same scenario with #1:
duplicity -t 3D --file-to-restore temp/logs sftp://[email protected]/my_backup /temp/logs
Solution 2
duplicity -t 3D --file-to-restore <foldername> file:///backup/location <destination folder>
Duplicity enters restore mode because the URL comes before the local directory.
-t 3D
3 days ago
If you want to check more information, here are useful links depending on the version:
- http://duplicity.nongnu.org/vers7/duplicity.1.html
- http://duplicity.nongnu.org/docs.html
- https://duplicity.readthedocs.io/en/latest/
![Lonnie Best](https://i.stack.imgur.com/IQpud.jpg?s=256&g=1)
Lonnie Best
Do your work willingly, as though you were serving the Lord himself, and not just your earthly master. -Colossians 3:23 The thing about quotes on the internet is that you cannot confirm their validity. -Abraham Lincoln
Updated on September 18, 2022Comments
-
Lonnie Best almost 2 years
Using the duplicity command, I need to specify the following:
- a specific folder to restore
- indicate time and date from which to restore
- indicate the destination to restore to
How can I specify these 3 things using the duplicity command?
-
der Michi over 2 yearsActually, when using the parameter
--file-to-restore
in duplicity 0.8.12 and specifying a file or directory to restore, I had to use the absolute path instead of a relative one. This is opposed to that the documentation states. Otherwise I always got an error message that the indicated file/path cannot be found in the backup.