You can still use #NextCloud. But to make it work as you are describing the following is required.
1) Create an SMB share
2) mount SMB share into Nextcloud
3) Each time there is a file change on the SMB share run a bash script to backup to a backup folder that will have every file. inotifywait can monitor any changes
I think you can configure Nextcloud version control and trash bin retention
./config/config.php
'versions_retention_obligation' => '60, 180',
'trashbin_retention_obligation' => '45, 90',
Read about these two, and set a number of days that work for you. This will
enable you to get deleted files from the trash bin and you can recover files of a specific version.
#Linux