Thank you for your quick reply.
The issue with the timeout command is that it stops rsync 10 seconds after the execution starts. If I have a large file to sync, it won't finish. I could repeatedly run this command with a longer timeout and the --partial option in rsync to resume unfinished transfers, but it wouldn’t be very clean. If you have another idea, I’d be glad to hear it. Otherwise I will go with this option.