I'm running a webserver in a VM.
In order to create consistent backups, I have to stop Apache, MySQL and other processes for a short time before doing a snapshot of the VM's harddrive (LVM-based).
However, there might be some cronjobs currently running on the VM that need access to the MySQL database. I don't want to interrupt them.
Therefore, I'm looking for a way to determine whether there are currently any cronjobs running. When it's time for a backup, I will wait until I don't "disturb" any cronjob.
Any ideas how to accomplish this?