Backup from specific directory without cd

I like to backup several directories with duplicacy.
I have a little script which looks like this for every directory:

cd /share/dir0
duplicacy backup -threads 2 -stats

cd /share/dir1
duplicacy backup -threads 2 -stats

cd /share/dir2
duplicacy backup -threads 2 -stats

cd /share/dir3
duplicacy backup -threads 2 -stats

Is there a more elegant way to do this?

Try using symlinks.

1 Like

I’d have a different sense of elegance here, but - regardless - there are also other options:

Admittedly, some concentration is necessary to wrap your head around how the --pref-dir option works (see this topic), so that might disqualify it for the elegance competition.

So what I’d do (and in fact do) is to create a single repository for /share and exclude/include the folders you (don’t) want using the filters file.

2 Likes