Restarting cron after changing crontab file?

后端 未结 11 1501
刺人心
刺人心 2020-11-30 16:38

Do I have to restart cron after changing the crontable file?

11条回答
  •  攒了一身酷
    2020-11-30 17:09

    Depending on distribution, using "cron reload" might do nothing. To paste a snippet out of init.d/cron (debian squeeze):

    reload|force-reload) log_daemon_msg "Reloading configuration files for periodic command scheduler" "cron"
        # cron reloads automatically
        log_end_msg 0
        ;;
    

    Some developer/maintainer relied on it reloading, but doesn't, and in this case there's not a way to force reload. I'm generating my crontab files as part of a deploy, and unless somehow the length of the file changes, the changes are not reloaded.

提交回复
热议问题