Make backup of contacts with bash script

Is it possible to backup (e. g. .csv or .vcf) ecloud contacts using bash/cli? I’ve tried wget -r -c --user myuser@murena.io --ask-password https://murena.io/remote.php/dav/addressbooks/users/myuser/kontakte, but could not make it work.

Regain your privacy! Adopt /e/ the unGoogled mobile OS and online servicesphone

I don’t use a caldav cli client myself, but vdirsyncer looks solid to scrape from a carddav endpoint that nextcloud offers:

http://vdirsyncer.pimutils.org/en/stable/config.html#storage-carddav

the curl should work if you provide it an active cookie (copy from your browser) or build the Authorization header yourself (you have to check if token/digest or basic auth is accepted):

curl 'https://murena.io/remote.php/dav/addressbooks/users/myuser/contacts/?export' -H 'Cookie: __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=myuser; nc_token=<>; nc_session_id=<>; oc_sessionPassphrase=<>'

there’s a gui option to export, but I think you deliberately want to have it in a shell script…

3 Likes