diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 8f953237..bfbdb650 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1677,7 +1677,10 @@ VCENTER-SSL(){ fi } ADD_LOGROTATE_CRONTAB(){ - (crontab -l ; echo "0 */1 * * * logrotate -f /opt/idssys/nodemgmt/tmp-logrotate")| crontab - + if ! crontab -l | grep -q '/opt/idssys/nodemgmt/tmp-logrotate'; then + (crontab -l ; echo "0 */1 * * * logrotate -f /opt/idssys/nodemgmt/tmp-logrotate")| crontab - + fi + /bin/chmod 0644 /opt/idssys/nodemgmt/tmp-logrotate echo "" echo -e "${idsCL[Green]}The crontab entry has been made${idsCL[Default]}" echo ""