"duplicacy info" command feature request

Feature request

Improve duplicacy info command to give information of the repository and storages without need for further options.

Rationale

Backup setups tend to be things that one once sets up and next time revisits those after several months or even years. While all the information can found out by using basic UNIX tools like cat ~/.duplicacy/Repo/preferences, there could be more user friendly way for this using duplicacy info.

Functionality (directional)

Here are couple of examples what the duplicacy info command could do.

List storages by default

# inside a configured repo
%> duplicacy info 
repository:    /path/to/repo
Storages:      b2-backup
               onedrive-backup

Storage info

# inside a configured repo
%> duplicacy info <storage-name>
repository:    /path/to/repo

name:          <storage-name>
--------------------------------------
id:            my-repo-id
storage:       b2://bucket-URL
encrypted:     true
filters:       -*.tmp
               -tmp/
               -*swp

Info of all storages

# inside a configured repo
%> duplicacy info -all
repository:    /path/to/repo

name:          b2-backup
--------------------------------------
id:            my-repo-id
storage:       b2://bucket-URL
encrypted:     true
filters:       -*.tmp
               -tmp/
               -*swp

name:          onedrive-backup
--------------------------------------
id:            my-repo-id
storage:       one://backup/dir
encrypted:     true
filters:       -*.tmp
               -tmp/
               -*swp
               -*.jpg

There are other things also what the info command could do, but this would be a good start.

Final words

As said all this information can be found out using cat etc. but this type of functionality would improve the usability of duplicacy.

PS. I can try to make PR, but I had issues building duplicacy form source. I will make a separate post or GH issue about this. It was related to versions of github.com/ncw/swift, github.com/vmihailenco/msgpack and github.com/googleapis/gax-go.. Somehow go had issues with v2 versions.

1 Like

I had no issues with building and submitting PRs off the latest master branch, so the issues are most likely with your setup. Just saying :wink:

While I like the general idea, it assumes that the default layout is used, which can be overridden by the -pref-dir and -repository options.

If -pref-dir is used, duplicacy info won’t work while the current working directory is the root of a potential repository (and anyone using it likely has a script, shell alias, and/or other method of organizing their collection of .duplicacy directories separately from their repositories).

Also, “default” is the default storage name, so for many CLI users they’d see the following nondescript output unless they happen to have more than one storage destination:

%> duplicacy info 
repository:    /path/to/repo
Storages:      default

Most Un*x systems already include at least a portion of the current pathname in the default shell prompt, and most terminal emulators display the entire pathname in the window title, so the “repository” line might be redundant (unless the -repository option was used).

How to best handle displaying longer filters (my primary backup filter is currently 74 lines), filters that import other filter files, and/or the -filter option?

Having duplicacy info behave a certain way if it’s a basic setup and another way if it’s a more advanced setup could be confusing for users.

Then there’s the following post from early last year…

… and the reply from @gchen:

I think so too. I am not that familiar with go’s dev setup so I don’t know what is wrong. Some how it seems the module dependencies described in Gopkg.toml are being ignore. The issue is only with packages with major version number 2 or higher. I made PR to another golang project and all worked just fine.