CLI download and delet a file in nextcloud

How could I:

  • List files in a Directory
  • Download all files
  • remove them if download was successfully

I try to create a little backup script running on my openWRT router.

Is there a way to do it with REST-API?
I tried it with python3 webdavclient3but my OpenWrt router miss some requirement I could not fulfill.

I think the approach is wrong. If you have a Nextcloud, then all you really need is a regular backup and files that you no longer need in the Nextcloud can simply be moved to the trash because you have got a backup. If you have different backup generations, you can always go back to other times. What you describe will go wrong at some point. Then you might as well leave it alone.


Do you have ssh/sftp-access to Nextcloud? Then you can delete the files and afterwards you can occ files:scan --all. But not very nice.

You describe things where it is better to do without Nextcloud altogether and use normal web storage, for example. Maybe you like Tiny File Manager instead with ssh/sftp.

Maybe cURL is an option?

venv and then installing pip allowed me to fulfill the requirement. now it works. thanks. @devnull

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.