How to download VFS files via the Linux terminal

Hello everyone! I’m working on a project where I need to create a shell script that periodically downloads one or more files from the ownCloud Desktop client to run some internal company processes. The problem I’m having is that the account I’ll be logging into has over 1TB of data, so to avoid filling up the disk, I need to use VFS.

My script is working perfectly already, but there’s one thing I haven’t been able to solve, even with help from Claude, Gemini, ChatGPT, or Google searches! I need to download the file via the Linux console if it has the .owncloud extension to perform data verification.

So far I’ve tried dozens of processes, such as trying head -c 50 (to force a read of the document), I tried cp (but it copies the .owncloud and doesn’t force the file download), among other processes that AI recommended, all resulting in failures.

Does anyone have any idea how to make this work, or how to only download files when someone downloads via Nautilus or another graphical file manager?

Thanks in advance for your help.

Welcome to the ownCloud Community.

I don’t know that ownCloud VFS on Linux is compatible with the CLI tools. Could you use selective sync instead?

Hello my friend, that’s exactly what I’ve noticed; it seems they haven’t added a way to force synchronization with console access.

In my case, it’s unfeasible because the account itself has more than 2TB of data, and the idea would be to only retrieve specific data, which generally ranges between 200 and 600 megabytes.

I’m leaning towards using webDAV or sshfs to access the data from this ownCloud and copy the files to the machine instead of using the ownCloud client with VFS enabled.

Those might work. For read/write operations, using WebDAV is likely most suitable. If using sshfs, I would stick to read-only.

Yes, I did the tests here with webdav and sshfs and they worked, it wasn’t what I wanted initially, but it will be the solution.

I would like to use the native option because of the ability to change data in both directions, since I can’t do that with sshfs, but I saw that using webdav worked normally, it’s just a much slower process to list the files, to find the data I need, but it’s within acceptable limits.

1 Like

If sshfs is substantially quicker, you might be able to useit, as long as you incorporate an appropriately scoped occ files:scan command afterward.