While duplicacy init, "-repository" switch is ignored

my version

duplicacy | grep -A1 VERSION
2.4.1 (808AE4)

All my vars

export storage_url=hubic://Jarvis/Radicale/
export storage_name=radicale
export snapshot_id=radicale_snapshots
export repository=/tmp/test

export hubic_token=/tmp/hubic-token.json
export backup_password=blablabla

display my repo

ls -l ${repository}

total 0
-rw-r--r-- 1 pi pi 0 Apr  4 20:45 my_files

Display creation command line

echo duplicacy init -e -repository ${repository} -storage-name ${storage_name} ${snapshot_id} ${storage_url}

duplicacy init -e -repository /tmp/test -storage-name radicale radicale_snapshots hubic://Jarvis/Radicale/

Execute command line from /tmp/

duplicacy init -e -repository ${repository} -storage-name ${storage_name} ${snapshot_id} ${storage_url}

Enter the path of the Hubic token file (downloadable from https://duplicacy.com/hubic_start):/tmp/hubic-token.json
Enter storage password for hubic://Jarvis/Radicale/:*********
Re-enter storage password:*********
Failed to save the preference file /tmp/.duplicacy/preferences: open /tmp/.duplicacy/preferences: permission denied

Display my repo again, with hidden files

ls -la /tmp/test

total 8
drwxr-xr-x  2 pi   pi   4096 Apr  4 21:58 .
drwxrwxrwt 25 root root 4096 Apr  4 22:10 ..
-rw-r--r--  1 pi   pi      0 Apr  4 20:45 my_files


  • Duplicacy tried to create ‘preferences’ file in current dir, instead of defined repository dir
  • Bonus: Despite ‘preferences’ file creation failed, remote files were created on my Hubic account.

Only 'init, ‘add’ and ‘info’ have ‘-repository’ switch

For other sub-command you have to be in the repository dir anyway, so maybe that’s better to remove ‘-repository’ switch ?

Also to check .duplicacy/preferences is writable before to create distant files

This is what Duplicacy is meant to do with the -repository switch. It should create .duplicacy\preferences and store the repository location as a field in that preferences file. You should therefore preserve the current working directory, which will be empty apart from the .duplicacy subdirectory, and invoke future commands for that repository from there.

Still :slight_smile: @gchen