Score:0

Cronjob is still running even after deletion

by flag

In one of my past project developed in Django python framework, I needed a cronjob to automate some process. I used this django-cron module and installed it as per their documentation. Everything was working as usual. Recently, the project was discontinued and every code and related processes were removed.

But I found that the cronjob related to that project is still running. I double checked with crontab -e, the cronjob is not there. I tried by reloading and restarting the cron daemon, even I restart the whole server, but in vain. If I check in /var/log/syslog, I still can see the cron is running every minute. Here is the output from syslog.

Jul 25 08:33:01 CRON[26412]: (ubuntu) CMD (cd /home/projects/pdf-generator && /home/venv/django/bin/python manage.py runcrons core.myapp.crons.PdfConversionCronJob)

The server is running Ubuntu 18.04.

Does anyone know what is going on and how to remove the cronjob for once and all?

hr flag
Also look in the system-wide crontab file `/etc/crontab` and files in `/etc/cron.d`. If you're not logged in as user `ubuntu`, check their crontab explicitly with `sudo crontab -u ubuntu -l` for example
moshfiqur avatar
by flag
@steeldriver Perfect. It was hiding in `/etc/crontab`. I removed it and it's gone. If you add your comment as answer, I can accept it as answer.
hr flag
Thanks - please see below
Score:1
hr flag

As well as a user's personal crontab (editable/viewable via crontab -e or crontab -l), cron jobs for a user may be run from

  • the system-wide crontab file, /etc/crontab

  • a file in the /etc/cron.d/ directory

If you are not currently logged in as user ubuntu you can check their personal crontab with sudo crontab -u ubuntu -l or sudo -u ubuntu crontab -l

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.