backup – Backing Up Synced Folder

I manage accounts server. I have to backup everything. I deployed a software that copies the data from specified locations multiple times a day, and pastes it into onedrive folder. Now since it is a public server, I have a basic fear for ransomware. If something encrypts all my files, so it will be synced to the cloud and i am with no backup? I couldn’t find much articles about what should I do in this situation?