# django cron tab does not runing every minutes

**URL:** <https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444>\
**Category:** Deployment\
**Created:** [March 4, 2022, 11:55am UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444 "2022-03-04T11:55:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sinaatkd](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sinaatkd/32/7247_2.png) [@Sinaatkd](https://forum.djangoproject.com/u/Sinaatkd)\
**Post date:** [March 4, 2022, 11:55am UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/1 "2022-03-04T11:55:25Z")

</div>

Hi,  
in my project i want to use django-crontab

**The work I have done**

**step 1**  
I executed the following command

```auto
pip install django-crotab

```

**step 2**  
I added `django_crontab` to **INSTALLED\_APPS**

**step 3**  
I was built a **text** app  
and I was added the following code to **text/models.py**

```auto
class Text(models.Model):
    text = models.CharField(max_length=500)

```

**step 4**  
I was built cron.py in the text app  
**text/cron.py**

```auto
def add_text():
    Text.objects.create(text='this is text')

```

**step 4**  
I added the following code to the settings.py file

```auto
CRONJOBS = [
    ('*/1 * * * *', 'text.cron.add_text')
]

```

**step 5**  
I with following command added crons

```auto
python manage.py crontab add

```

but when running deployment server, cron not working every minutes ☹

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 4, 2022, 12:33pm UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/2 "2022-03-04T12:33:02Z")

</div>

Did you run that `add` command on your deployment server?

Did you verify that you have a `crontab` command in `/usr/bin`?

The package does state that it does not work with Windows. If you’re trying to use it on Windows, it’s not going to work.

Also, your server configuration needs to allow for per-user cronfiles. (That may or may not be the default in your particular installation.)

You may also need to restart cron after the initial creation of a user-crontab file.

Finally, your server needs to be running cron and not an alternative scheduler. (Highly unlikely, but possible.)

---

<div class="post-metadata">

**Author:** ![Sinaatkd](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sinaatkd/32/7247_2.png) [@Sinaatkd](https://forum.djangoproject.com/u/Sinaatkd)\
**Post date:** [March 4, 2022, 1:05pm UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/3 "2022-03-04T13:05:19Z")

</div>

> [@KenWhitesell](#):
>
> Did you run that `add` command on your deployment server?
> 
> Did you verify that you have a `crontab` command in `/usr/bin` ?
> 
> The package does state that it does not work with Windows. If you’re trying to use it on Windows, it’s not going to work.
> 
> Also, your server configuration needs to allow for per-user cronfiles. (That may or may not be the default in your particular installation.)
> 
> You may also need to restart cron after the initial creation of a user-crontab file.
> 
> Finally, your server needs to be running cron and not an alternative scheduler. (Highly unlikely, but possible.)

my OS is linux manjaro  
All configurations appear to be correct  
And when I run the following command, cron works properly

> `python manage.py crontab run`

My only problem is that the crons do not run every minute and I have to run them manually, which in this case only runs once, not every minute.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 4, 2022, 1:23pm UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/4 "2022-03-04T13:23:37Z")

</div>

If you’ve verified that all your configurations are correct, then you realize that this is not a Django issue, right? It’s not Django that is supposed to be running these jobs.

---

<div class="post-metadata">

**Author:** ![Sinaatkd](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sinaatkd/32/7247_2.png) [@Sinaatkd](https://forum.djangoproject.com/u/Sinaatkd)\
**Post date:** [March 4, 2022, 1:37pm UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/5 "2022-03-04T13:37:59Z")

</div>

I saw all the YouTube videos about cron in Django, but it didn’t help.  
What do you think I should check?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 4, 2022, 2:04pm UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/6 "2022-03-04T14:04:00Z")

</div>

This is not a Django issue. This has nothing to do with Django.

The only function performed by the django-crontab project is to create the user crontab file.

If everything is configured correctly, the end result of the `add` command is that a proper user-crontab file is created with the entries you’ve defined. Everything that happens after that is the responsibility of **only** cron. Django is not involved at that point.

You need to validate your cron configuration along with the content of your crontab file(s).

---

<div class="post-metadata">

**Author:** ![Sinaatkd](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sinaatkd/32/7247_2.png) [@Sinaatkd](https://forum.djangoproject.com/u/Sinaatkd)\
**Post date:** [March 5, 2022, 8:41am UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/7 "2022-03-05T08:41:18Z")

</div>

Thanks You,  
The problem was that the cron service was not running

---

<div class="post-metadata">

**Author:** ![AkshayDawkhar](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/akshaydawkhar/32/16800_2.png) [@AkshayDawkhar](https://forum.djangoproject.com/u/AkshayDawkhar)\
**Post date:** [November 3, 2023, 5:10am UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/8 "2023-11-03T05:10:52Z")

</div>

how do you solve this getting same issue linux manjaro, django, corntab

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 3, 2023, 12:27pm UTC](https://forum.djangoproject.com/t/django-cron-tab-does-not-runing-every-minutes/12444/9 "2023-11-03T12:27:44Z")

</div>

This is an old topic that was solved. If you’re having a deployment issue with cron, please create a new topic for discussion, along the the appropriate details concerning your configuration and code implementation.
