2

I searched through the whole internet but it seems im am the only one with this problem?

In the Magento (Version 1.7.02) Scheduler Timeline i got a running cronjob that runs since 15.12.2014 till now. Is there any way to delete / stop this job? Server reboot, deactivation of the job didn't work.

2
  • what happen if delete the file? Commented Jan 27, 2015 at 9:48
  • no effect on the behaviour ;(
    – Cenzo
    Commented Jan 27, 2015 at 11:26

2 Answers 2

3

The job is not really running, the timeline view only visualizes jobs by their "start" and "end" time. Usually the Cron runner can handle cases of error and set the end time. But in case of a fatal error this does not happen, the job has ended without setting the state in the database. This happens for example if you exceed the memory limit.

To notice this, you should validate if such errors get into the error log or validate your crontab config, if it not only puts stdout but also error to /dev/null.

You can simple delete this run from the table, it will have no negative effect, and if it had ended would get cleaned anyway after the configured amount of days.

2
  • 1
    That's a good answer. You can safely delete old cron jobs from the cron_schedule table Commented Jan 27, 2015 at 14:55
  • U yea ! Thank you so much for the explanation! It was indeed just a "display error". Now everything looks fine again !
    – Cenzo
    Commented Jan 27, 2015 at 15:32
0

if you want to stop the cron job programmatically then you can get the process id of CRON job when it start executing at very beginning of the script by getmypid and then save it in database with date and time. Then you have to make a cron job that should run after your threshold time, which will check if your script is still running then you kill the process by posix_kill

1
  • 1
    Thanks for your answer but my job is already running since 15.12. so i have no process id
    – Cenzo
    Commented Jan 27, 2015 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.