Credentials in environment variables

Hello,

it should now be possible to provide credentials via environment variables.

Could someone help me setting up a script that sets these variables and then calls the nextcloudcmd?

Currently I have the following script:

#!/bin/bash

dest="/mnt/backups"
ncurl="https://cloud.XXXXXXXXXXX/"

export NC_USER="XXXXXXXXXXX"
export NC_PASSWORD="XXXXXXXXXXX"

/usr/bin/flock -n /tmp/syncnextcloud.lockfile nextcloudcmd --non-interactive "$dest" "$ncurl"

And I keep getting the error: “Server requested authentication and we didn’t provide a user”.

What am I missing?

Thanks!

What version of the client?

From what I see, that feature was just merged last week. I believe it’s only in a release candidate at the moment.

Refs:

Hi,

Nextcloud version 3.16.6-20250628.084039.957b27497-1.0~noble1
Using Qt 6.4.2, built against Qt 6.4.2
Using 'OpenSSL 3.0.13 30 Jan 2024'
Running on Ubuntu 24.04.3 LTS, x86_64

BR