0

Duplicacy is a great backup tool (not an employee, but I love them), but I recently tried to do something that I didn't find any great information on how to do. I'm using Duplicacy CLI on a linux machine

Basically I want to use the Duplicacy list command to get the size of a directory that I want to restore before restoring. In my case I was trying to see how large a specific virtual disk needed to be sized. However, there does not appear to be a native way to get this information or use filters with Duplicacy's list command.

1 Answer 1

0

Assuming you have your Duplicacy storage set up, you know the revision you want to restore from, and the path to restore, here's how you can get the size of the directory you want to restore:

duplicacy list -r <revision number> -files | egrep '\s<directory>' | egrep -o '^\s?[0-9]*\s' | awk '{ sum += $1 } END { print sum}'

For example, you might use the following to get the size of the plexShare folder. The output should be the size as provided by Duplicacy for each matching file (all files whose paths contain the directory you grepped for with the first egrep) summed up:

root@storageMachine:/storage# /opt/duplicacy/duplicacy_linux_x64_2.7.2 list -r 1694 -files | egrep '\splexShare' | egrep -o "^\s?[0-9]*\s" | awk '{ sum += $1 } END { print sum}'
4276075032959

For reference and in case anyone wants to improve on this technique, Duplicacy outputs the file list in this format:

size date time sha256 path

For example:

 206059 2019-07-14 10:13:36 ad207d3e1165a9adc271c7d4bf34c000c98c49eb637a8d2d338b35e01c7fecf2 plexShare/Music/coolArtist/Singles/sweetAlbum/cover.jpg

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .