.duplicacy folder is not created

The official docs says:

By default a .duplicacy folder is created in the root of the repository

But when I run:

cd /mnt/user/documents/
duplicacy init -e documents /mnt/disks/ABC123/

I don’t see the .duplicacy folder created anywhere.

The only thing I see is:

/mnt/disks/ABC123/
├── chunks
├── config
└── snapshots
    └── documents

Is the documentation correct? What’s going on?

My bad.

I just learned that Unix-like systems doesn’t list hidden folders by default. Using ls -a revealed the .duplicacy folder in the repository.

Now that I have your attention, is it possible to have a single directory for all backup metadata instead of having .duplicacy folders scattered across the entire file system?

Yes, you can initialize repository elsewhere. See https://github.com/gilbertchen/duplicacy/wiki/init:

-repository <path>              initialize a new repository at the specified path rather than the current working directory

You can also create a new folder, initialize repository there and then symlink all the stuff you need to backup into that folder. Duplicacy follows first level symlinks. I personally prefer this approach, it seems cleaner and localized, as opposed to having yet another folder for each repository, or, as you noted, littering into repository with some transient shite and needing to have multiple repositories just because data happens to live across different directory structures.

Using -repository <path> is just another way to specify the repo, right? The result is the same as if I changed directory to that path and then ran init, right? Not sure how that will help. The .duplicacy folder will still be added to that repo path, if I understand correctly.

Regarding symlinks I could not really understand what you are saying.

What I want is just to have one folder (for example /mnt/user/configs/duplicacy/) and have all metadata and settings or whatever in there instead of having .duplicacy folders and metadata in every single repo.

Let’s say you want to backup /homes, but don’t want /homes/.duplicacy to be created.

So you create another folder, for example, /var/duplicacy and initialize repo there

mkdir /var/duplicacy
cd /var/duplciacy
duplicacy init -repository /homes ....

The .duplicacy folder will be created in /var/duplicacy, not in /homes.

Then to backup /homes, you cd /var/duplicacy && duplicacy backup.

Lets say you want to backup /users, /games, /mnt/some-server/pile-o-junk, but don’t want to initialize three different repositories. Instead, you can:

mkdir /var/duplicacy
ln -s /users ./users
ln -s /games ./games
ln -s /mnt/some-server/pile-o-junk ./pile-o-junk
duplicacy init  "all my stuff" <storage url>

Then to run backup you do cd /var/duplicacy && duplicacy backup. Because duplicacy follows first lever symlinks all your data under /users, /games, /mnt/some-server/pile-o-junk will get backed up.

That’s precisely what I described.

Ok got it. Thanks. :pray:

For my future self, this is how I did it. Of course I can automate this in the future.

First I make a folder for the metadata:

mkdir -p /mnt/user/admin/configs/duplicacy/immich

Then I add a folder for the backups in the destination:

mkdir -p /mnt/disks/ABC123/duplicacy_backups

Then I cd into the source (repo):

cd /mnt/user/admin/configs/duplicacy/immich

Initialize it with -repository:

duplicacy init -e -repository /mnt/user/immich/ immich /mnt/disks/ABC123/duplicacy_backups

Then I cd into the metadata folder:

cd /mnt/user/admin/configs/duplicacy/immich

And run the backup:

duplicacy backup -stats

To add another repo I basically do the same (except for adding a folder for the backups).

1 Like