Stopping Cron Job Process

Discussion in 'General' started by John Lanz, Nov 17, 2016.

  1. John Lanz

    John Lanz New Member

    Hi Guys,
    I've added a cron job at ISPConfig Cron Jobs UI and I had some error on the script that I'm running. Now I wan't to stop it without restarting the OS.
    So I've execute: service cron stop
    and I remove the cron job at ISPConfig UI but when I start the cron job, the process is still there. I've already tried pkill -u root cron still not working.
    My only option now is to restart the OS but I can't do it currently because I have an online users so I disabled all the the cron jobs currently.
    How can I stop those cron job process without restarting the OS?

    Thanks,
    John
     
  2. sjau

    sjau Local Meanie Moderator

    what distro?
     
  3. John Lanz

    John Lanz New Member

    Hi sjau, I'm using debian 8
     
  4. sjau

    sjau Local Meanie Moderator

    Debian Jessie uses SystemD now.

    Check if cron is running
    Code:
    systemctl status cron
    
    If so, stop it
    Code:
    systemctl stop cron
    
     
  5. John Lanz

    John Lanz New Member

    Hi sjau, Thanks for the reply.
    The cron job is already stopped but the problem is when I run the cron job again I still see the process of the script that I'm running a while ago. The script consumes my memory and other resources.
    How can remove those cron job that is currently running?
    Stopping the whole cron job doesn't solve the issue. It seems that ISPConfig save the cron job script and restart it again once the cron job is started.

    Thanks,
    John
     
  6. sjau

    sjau Local Meanie Moderator

    I have no idea what is actually run. If you stop cron, then it won't run any further cron jobs. Current jobs still will continue to run though.
     
  7. John Lanz

    John Lanz New Member

    Hi sjau,
    Ok for clarification I've added a cron job script from the ISPConfig UI. That script somehow has an error and consumes my resources and I wan't to stop it from running.
    I've stopped the cron job and delete the cron job script from ISPConfig and it works fine I can't see the script running.
    The problem is when I start the cron job again using "systemctl start cron" my error script seems restarted and its running again.
    Hopefully its much clearer now.
    Thanks,
    John
     
    Last edited: Nov 17, 2016
  8. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    website cronjobs will be in a separate file per-site under /etc/cron.d/ispc_web# - just find the right one, edit it and comment the bad job so it doesn't run. I'd guess it would also work to remove the file, but commenting it should make sure ispconfig's cronjob management is happy when it goes to delete that file.
     

Share This Page