I recently discovered that the User Profile Synchronization Service was being stopped nightly, around 1:30 AM. The sync timer job was set to run at 1:00 AM, as was my backup job – which is a set of scheduled tasks which call PowerShell scripts using Backup-SPFarm.
I was also getting the following error in my spbackup.log files: Object User Profile Synchronization Service failed in event OnBackupComplete. For more information, see the spbackup.log or sprestore.log file located in the backup directory.
After a few days of playing around with timing, I noticed that if I scheduled the synchronization timer job to run at an earlier time (9pm as an example) then the backup would completely successfully. In addition to the successful backups, the User Profile Synchronization Service continued to run without stopping.
I still have not figured out the exact issue, as this same configuration was working – but I’ll take the workaround.
To recap: Change the user profile synchronization timer job to run at an earlier hour so that it is not running in parallel with the backup scripts.
I will post an update if I find the root cause.