Lighter-weight nextcloudcmd packaging?

I have a small, headless, NFS- and PXEboot-server running on a Raspberry Pi 4 (Raspberry OS, bullseye, 64-bit). I need to run nextcloudcmd to synchronize files with my nextcloud instance. I can install nextcloud-desktop-cmd, but the extensive prereq chain means that I’ll need to install and maintain 141 packages! The entire server without nextcloudcmd only has 720 packages, so that would be a 20% increase for one command.

Some of the packages include x11-common, libxrandr2, libwayland-client0, and mesa-vulkan-drivers. These are all tools for graphical systems. I’m sure these are pulled in by other prereqs, but this seems really excessive for a command-line tool that does some basic network communication and some admittedly complex file synchronization.

Is there anything I can do to get a lighter-weight nextcloudcmd that only pulls in the libraries it really uses? Better, is there anything we can do to trim down nextcloud-desktop-cmd to just what it needs? I’ve only got a little server here. I don’t want to install and maintain a bunch of packages on it that aren’t really used.

Thanks in advance for any suggestions.

you can mount Nextcloud via WebDAV and sync the files using whatever sync tool you like (copy, rsync etc…)

Thank you for responding, and thank you for the suggestion. It never occurred to me to look for a direct WebDAV interface in Linux. I’ll check that out. If the performance is reasonable, that’s a perfect solution.

One may have more than just calendar and contacts to back up. Also, I find the completely unnecessary dependencies to be aesthetically offensive.

This might make a good Google Summer of Code project.

For files, you could use Rclone, which I think is as good as it gets when it comes to command-line filesync tools, so I don’t think it makes sense to build something from scratch specifically for Nextcloud.

If you want a full backup of your Nextcloud instance, you’ll also need to back up the database, which a simple sync client won’t be able to do. There is a Backup app in the Nextcloud App Store that can create backup images of your Nextcloud instance, including the database, but I’ve never tested it so I can’t tell you how well it works.

If you like you can mount WebDAV with davfs2.

You could install with --ignore-depends (dpkg) and then only install what really is missing. When you’re done, you could edit /var/lib/dpkg/status to that result (which you may have to repeat on updates).
It’s not really comfortable, I know, but it might be suitable in your use case.

Running into the same issue. Did the OP make any progress? How do people generally solve this (running the client on headless systems)? I see that the question comes up time and again, but can’t find any real answers.

I’d say most people don’t.

As the name suggests, the Nextcloud desktop client is not really meant to run on headless systems. I mean, you can install it and use nextcloudcmd, and @nxov even provided a hint on how you might be able to reduce the number of packages that get installed as dependencies, which I think is as good as it gets.

Also, nexloudcmd doesn’t do real-time synchronisation, so you’ll likely need to script something and set up a cronjob or systemd timer to automate the synchronisation process anyway, in which case you might as well just use Rclone, which doesn’t come with as many dependencies in the first place.

Ok thanks for the suggestion. My concern would be how rclone handles renaming and deletions. It is to be expected that the ‘native’ client would be optimal in this respect, but I’ll give it a try!

There is a request for a lighter CLI version, you can give it a thumbs up if you’d like to have it: