How to detect from a script that a TimeMachine backup is running?
There is a duplicate question covering this, but the answer is tmutil status will tell you any time a backup is in progress as well as details about the backup.

You can use tmutil then to turn off backups if desired or even read the list of backups so you can predict how many minutes to the next scheduled backup. We had something similar and then just decided to kick off a backup when the copy finishes so that whether or not a backup was in progress - we get a strong chance of a consistent backup at the end of the copy operation.