gilbertchen / duplicacy

A new generation cloud backup tool
https://duplicacy.com
Other
5.23k stars 338 forks source link

How To ? #132

Closed jbrodriguez closed 2 years ago

jbrodriguez commented 7 years ago

I like the lock-free concept, although the tooling is a bit complicated to me.

I'd like to do this (macOS):

cd /volume1
duplicacy init primary sftp://xxxx/primary

cd /volume2
duplicacy init primary sftp://xxxx/primary
duplicacy add secondary secondary sftp://xxxx/secondary

nano /volume1/.duplicacy/filters
+folder1/*
-*

nano /volume2/.duplicacy/filters
+folder2/*
-*

I want folder2 to go to primary, but then a folder3 go to secondary.

The issue is that /volume/.duplicacy/filters is shared across the volume, so I can't set +folder3/* there: it would copy folder2 and folder3 to both primary and secondary.

Not sure if I'm looking at it the wrong way.

Any suggestions ?

jmfederico commented 7 years ago

Why not create one repo inside of folder2 and one inside folder3?

TheBestPessimist commented 7 years ago

I think there is a problem here (may be wrong though):

cd /volume2
duplicacy init >>>>>>>>>>>>>>>primary<<<<<<<<<<<<<<  sftp://xxxx/primary
duplicacy add secondary secondary sftp://xxxx/secondary

The way i understand things that is the repository ID. Said repository id should be unique for your storage (that is the destination, which in your case is sftp://xxxx/primary, which is the same as the one used for /volume1.

I think you should name that repository secondary, or even better: volume2.

Sorry if i missunderstood what you want to do, maybe you could explain better?

jbrodriguez commented 7 years ago

Why not create one repo inside of folder2 and one inside folder3?

Yes, that would be one way to do it. But, I presented a simplified scenario, I should have mentioned that in volume2, I want to backup more than one folder to each storage url

I'd find it tedious to have to init a repo in each folder, not to mention that I think it'd miss to transfer the parent folder hierarchy

/volume2 -- folder2 (to primary) -- folder3 (to secondary) -- folder4 (to secondary) -- folder5 (to secondary) ``-- subf1

the backup for folder5 (for example), would start subf1/, not folder5/subf1/, which loses hierarchy.

jbrodriguez commented 7 years ago

Said repository id should be unique for your storage

But you can duplicacy add another storage, which could (should?) have a different snapshot id, no ?

TheBestPessimist commented 7 years ago

Yes you can, but i think you should just init /volume 2 with secondary, instead of init primary (2x primary at this point) and then add secondary to a different storage folder.


What i would do though is as follows: this:

duplicacy init primary sftp://xxxx/primary
duplicacy add secondary secondary sftp://xxxx/secondary

i would change to this:


duplicacy init secondary sftp://xxxx/primary
```.

This does the following:
- save all the data to only one folder on the storage so i can have as much deduplication as possible
- create 2 different repositories which contain different data, and each repository (!=storage) has its own configs and filters.
jbrodriguez commented 7 years ago

What i would do though is as follows

I thought I had tried that, but I double checked anyways:

cd /volume2
duplicacy init primary sftp://xxxx/primary

is ok, but

duplicacy init secondary sftp://xxxx/primary
or 
duplicacy init secondary sftp://xxxx/secondary

fail (the repository has already been initialized), I assume because .duplicacy is already present

gilbertchen commented 7 years ago

Create a repository under /volume2 that backs up to secondary but excludes folder2, and then another repository under /volume2/folder2 to primary, would this work?

cd /volume2
duplicacy init secondary sftp://xxxx/secondary
nano /volume1/.duplicacy/filters
-folder2/*
+*

cd /volume2/folder2
duplicacy init primary sftp://xxxx/primary
jbrodriguez commented 7 years ago

It sort of works.

Yes, it backs up everything I want to secondary, and it sort of backs up folder2 to primary.

This is because the parent folder (folder2) is not stored, only its subfolders.

This way duplicacy list -files for primary looks like folder1 (from volume1) folder1/subfA folder1/subfB ... subf2 (from volume2, but this should be folder2/subf2 ☹️ )

You mention restic in your comparison to other tools.

They do without a .duplicacy-like folder and allow specifying file inclusion/exclusion from the command line, which seems to be a more natural experience.

Have you given any thought to doing something similar or is .duplicacy a fixed requirement ?

Maybe allow setting filters from the command line ?

gilbertchen commented 7 years ago

It is not hard to add include/exclude arguments to the backup command. I'll do that.