Currently, the files are being synced as they change in the source after a specific interval, but wouldn't it be better if there is an additional variable called something like "secure_backup_interval" after which if the file is changed in the source, the version stored in the destination first is copied with the current timestamp and then make a copy of the new edited file ?
I think this is a good problem to solve.
Also, input proper logs in safesync.log with the exact names of the files which are being renamed in the destination along with the name of the file which is being copied after this rename from source to destination.