Pref-dir doesn't do anything

I have two directories I want to back up:

/home/user/photos
/home/user/documents

If I initialize the first one (/home/user/photos) from my /home/user directory, it works and creates a .duplicacy/preferences file in my /home/user directory as expected. However if I try to now initialize a new repository for my /home/user/documents directory, I get an error message that the repository has already been initialized. I am forced to first change directories to /home/user/documents and then initialize from there. This creates a new .duplicacy/preferences file there. I don’t like having separate .duplicacy/preferences in every directory I want to back up.

The workaround I have that works is to copy the information from each separate .duplicacy/preferences to my “main” /home/user/.duplicacy/preferences file and then remove the separate .duplicacy/preferences from each location I have.

I tried the pref-dir during initialization but that option doesn’t seem to do anything.

What is the proper way to use the pref-dir option?

The -pref-dir option is not recommended as it has been deprecated.

You can run duplicacy init under /homeuser/, and then create a file .duplicacy/filters containing the following include patterns:

+photos/*
+documents/*

You can find more information on include/exclude patterns on Include Exclude Patterns · gilbertchen/duplicacy Wiki · GitHub

Is there a way to create/initialize multiple repositories without changing directories first and running the init command and have multiple repositories show up under one “main” ./duplicacy/preferences.

If I manually edit my ~/.duplicacy/preferences file it works but it’s a pain to do it manually.

For example here is my preferences file, that I edited by pasting all of the .duplicacy/preferences files from the different directories:

$ cat .duplicacy/preferences

I redacted some of this for security purposes

[
    {
        "name": "photos",
        "id": "photos",
        "repository": "/home/user/photos",
        "storage": "sftp://",
        "encrypted": true,
        "no_backup": false,
        "no_restore": false,
        "no_save_password": false,
        "nobackup_file": "",
        "keys": {
            "password": "storagepassword",
            "ssh_key_file": "/home/user/.ssh/id_rsa"
        },
        "filters": "",
        "exclude_by_attribute": false
    },

   {
        "name": "documents",
        "id": "documents",
        "repository": "/home/user/documents",
        "storage": "sftp://",
        "encrypted": true,
        "no_backup": false,
        "no_restore": false,
        "no_save_password": false,
        "nobackup_file": "",
        "keys": {
            "password": "storagepassword",
            "ssh_key_file": "/home/user/.ssh/id_rsa"
        },
        "filters": "",
        "exclude_by_attribute": false
    },
    {
        "name": "public",
        "id": "public",
        "repository": "/home/user/Public",
        "storage": "sftp://",
        "encrypted": true,
        "no_backup": false,
        "no_restore": false,
        "no_save_password": false,
        "nobackup_file": "",
        "keys": {
            "password": "storagepassword",
            "ssh_key_file": "/home/user/.ssh/id_rsa"
        },
        "filters": "",
        "exclude_by_attribute": false
    }
]
````Preformatted text`