I’d like to connect a usb-disk to my home assistant pi and run rsync, to sync data from a remote server to this disk. Background is, I do have a self hosted Nextcloud and I would like to keep the remote files in sync with a local backup. I thought while the pi is running all the time anyway, it would be convenient to use it. Is it possible?
Mounting drives can VERY much break your system. If the drive mounted brings the backup size bigger than available, for instance, the drive will fill up and the system will crash. If you plug in a memory stick, for instance, with malware, that would cause all kinds of problems. That is why this is not supported and if you do find a way to do it, you will be using an unsupported version of HAOS and you will be on your own when it breaks,
It is absolutely not recommended behavior, however it is not impossible to do.
I feel that the amount of effort it takes to know and understand how to do it is warranted before you be able to have something mounted and decide to take on full support role.
Plus if you really want a drive mounted, install core or another install method where you are in control of the OS.
There is a shell integration that can run a script for you that you can automate.
If you trust the source of the data then that would be the way to go.
Do mind that the RSYNC to a USB might be slow to running in the evening when you sleep is recommended.