blog:1c_restart

1c restart

cat /root/ragent.sh

#!/bin/sh 
 
state=`service srv1cv83 status | /bin/grep 'Ragent: NOT RUNNING.'` 
notrun="Ragent: NOT RUNNING."
dt=`date '+%d/%m/%Y %H:%M:%S'`
lf=/var/log/ragent.log
 
if [[ "$state" == *$notrun* ]]; then 
service srv1cv83 restart
        echo "$dt — 1C ragent service failed to run! Will be restarted now." > $lf
else 
        echo "$dt — OK" > $lf
fi

crontab -l

*/5 * * * *     /bin/bash       /root/ragent.sh
  • blog/1c_restart.txt
  • Последние изменения: 2020/01/09 13:04
  • admin