Trying to run saspus/duplicacy-web docker

Running the saspus/duplicacy-web docker on unraid.
I want to test my filter arguments, and I am trying to run the duplicacy CLI from the docker console.

I see the downloaded binary here:

/config/bin # ls -ls
total 25768
25768 -rwx------    1 duplicac duplicac  26382872 Aug 31 21:36 duplicacy_linux_x64_2.2.3

When I try to run it, I get a not found error?

/config/bin # duplicacy_linux_x64_2.2.3
sh: duplicacy_linux_x64_2.2.3: not found

Any ideas where to find the actual CLI?

You should run it with

./duplicacy_linux_x64_2.2.3

since you’re running it from the current folder

Ah, ok, great, my poor linux skills at play.

Next question, how can I invoke the CLI using exactly what the web would do?
I can see in the log what options are used, but the authentication parameters are not logged, so when I run the CLI using the options from the log, my setup asks for the B2 auth parameters.
I assume the web is pointing the CLI at the config files, but I don’t see it being logged.

E.g. from log:

Running backup command from /cache/localhost/1 to back up /backuproot/media
Options: [-log backup -storage B2-Media -stats]
202019-09-12 02:00:01.941 INFO REPOSITORY_SET Repository set to /backuproot/back2012019-09-12 02:00:01.941 INFO STORAGE_SET Storage set to b2://ptr727-Duplicacy-Server-1-Bac20192019-09-12 02:00:47.471 INFO BACKUP_START Last backup at revision 6 found
2019-09-12 02:00:47.472 INFO BACKUP_INDEXING Indexing /backuproot/backup
2019-09-12 02:00:47.472 INFO SNAPSHOT_FILTER Parsing filter file /cache/localhost/0/.duplicacy/filters
2019-09-12 02:00:47.472 INFO SNAPSHOT_FILTER Loaded 0 include/exclude pattern20192019-09-12 02:06:27.802 INFO LIST_ATTRIBUTES Discarding file attributes
2019-09-12 02:25:14.940 INFO BACKUP_END Backup for /backuproot/backup at revision 7 completed
2019-09-12 02:25:14.940 INFO BACKUP_STATS Files: 1627102 total, 1254G bytes; 0 new, 0 bytes
2019-09-12 02:25:14.940 INFO BACKUP_STATS File chunks: 296908 total, 1254G bytes; 0 new, 0 bytes, 0 bytes uploaded
2019-09-12 02:25:14.940 INFO BACKUP_STATS Metadata chunks: 165 total, 872,072K bytes; 0 new, 0 bytes, 0 bytes uploaded
2019-09-12 02:25:14.940 INFO BACKUP_STATS All chunks: 297073 total, 1255G bytes; 0 new, 0 bytes, 0 bytes uploaded
2019-09-12 02:25:14.940 INFO BACKUP_STATS Total running time: 00:25:10

From my CLI:

/ # cd /cache/localhost/1
/cache/localhost/1 # /config/bin/duplicacy_linux_x64_2.2.3 -log backup -storage B2-Media -stats -enum-only
2019-09-12 15:57:41.151 INFO REPOSITORY_SET Repository set to /backuproot/media
2019-09-12 15:57:41.151 INFO STORAGE_SET Storage set to b2://ptr727-Duplicacy-Server-1-Media
Enter Backblaze account or application id:

How would I let the CLI use the preconfigured storage auth data from the config files?

For this i am unsure, but i would expect you’d have to somehow move into the folder .duplicacy/ (of your repository) which i think is located in ~/duplicacy-web/<some/folders/here/>
and then run the normal :d: commands.

Looks like duplicacy-web is located here:

/ # ls -a ./usr/local/bin
.              ..             duplicacy_web  init.sh        launch.sh
/ # 

Looks like session configuration files are here:

/ # ls -a ./cache/localhost/1
.           ..          .duplicacy
/ # 

And config files are here:

/ # ls -a ./config
.               bin             filters         machine-id      stats
..              duplicacy.json  licenses.json   settings.json
/ # 

And CLI only runs when I run it from one of the session config folders, similar to what is reported in the log files.

Until I can figure out how to run the CLI I am just modifying the web backup job parameters.

the only problem is that i dont see where the path to duplicacy CLI executable is, as i only see a duplicacy_web. if we’d know that we could easily do something like:

cd /cache/localhost/1

/full/path/to/duplicacy_CLI.exe  backup

and I’d expect it to work

See an earlier reply where I already tried this, and I am prompted for the B2 Id.

Oh, my bad, i see you already tried this. In that case i’m out of ideas and maybe someone else should step in. Maybe @saspus?

This is really a question not related to that specific container: it literally boils down to “how does duplicacy_web launch duplicacy CLI?”.

I guess you could replace duplicacy CLI with a script that would simply dump environment and command line arguments passed and then emulate the same environment?

There is more than one ways how credentials can be passed to the CLI – config file and environment variables are the ones that come to mind.

1 Like

The web GUI passes the credentials in environment variables to the CLI, so there isn’t a way to use credentials stored in the web GUI if you want to manually run the CLI.

However, the CLI may only ask for the credentials first time. Depending on your OS, the CLI can store the credentials you input in an encrypted key vault like Keycain/Keyring so it will be able to retrieve them from there afterwards.