View file File name : salt_run Content :# This cron runs any salt states that apply to this box every 30 minutes. It also logs any changes or errors to /root/salt_run_log. # The time, date, and how long it took to run each time is also recorded at the bottom of the log. PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin MAILTO="" SHELL="/bin/bash" #0,30 * * * * root LANG=en_US.UTF-8; /usr/bin/perl -le 'sleep rand 1800' && { { printf '=\%.0s' {1..80}; echo;} >> /var/log/salt/salt_run_log; time salt-call state.apply --output-diff | tee >(sed "s/^/$(date +"\%Y-\%m-\%d \%H:\%M:\%S") /" >> /var/log/salt/salt_run_log) > /root/salt_run_log 2>&1; date >> /root/salt_run_log; } 2>> /root/salt_run_log