There are actually two ways you can do this.
Modify the script method
Locate and modify the script that runs the SaltStack update. It could be something like
bootstrap-salt.sh, but it could be anything. Try looking for it in your process list while the update is running (
ps -ef |grep -i salt). it should be something with .sh at the end. Once you have located the script, you can insert at the top of the script a line that disables cron. This is the safest method.
This can be either of the following:
crontab -l -u root > /root/cron.bak
crontab -r -u root
Note: The later only works on the user you list and is dependent how you are managing cron. For example, this method will not disable any jobs listed in
/etc/cron.daily/ cron.hourly/ cron.monthly/ or cron.weekly/. If you decide to use this method, it would be best to actually identify the process you do not want running at the same time as your SaltStack update and disable the cron which runs that process specifically.
Then at the end of the script one of the following:
crontab -u root /root/cron.bak
Run a daemon method
Write a script that runs as a daemon to check for a running process, but this is less reliable and would have a chance to miss during the time gap while the script loops. The only way to mitigate it would be to just loop it without a sleep, but again, that's not really advised. I would use this method only as a last resort if you are unable to locate or modify the script that launches the update for SaltStack.
The daemon script would look something like this:
# this might have to be tweaked based on the process you are looking for
SaltUpdateRunning=$(ps -ef |grep -v grep |grep -i salt |grep -i update | wc -l)
if [ $SaltUpdateRunning -gt 0 ]
sleep 3600 # 1 hour just to be safe - you can modify to
# match the runtime of SaltStack update
sleep 1 # this is for safety but you can remove and it will loop
# much faster with less chance to miss the running process
You should also look into SaltStack's ability to manage cron. I am not sure if there is a way for it to automatically disable cron or certain processes while the update is running, but it wouldn't hurt to dig a little deeper into it's abilities.