简体   繁体   中英

Multiple Cron jobs in one crontab file

I wanted to implement two cronjobs with different execution time. One cron job is for sending emails and second cron job for validating my application subscriptions.

I write one crontab file and write to two cronjob as follows:

2 * * * * path to mailCronjob mail.php
20 * * * * path to check my application's subscriptions sub.php

The problem is first cronjob is working fine. Mail will delivers fine, but the second cronjob is not working. I tried to run second job manually, its also working fine.

I am using command to set cronjob as:

crontab crontab_file

when I give command crontab -l it also shows both cronjob in command line.

I wanted to ask, am I missing something here, or what should I do to run those cronjobs.

I wanted to implement two cronjobs with different execution time. One cron job is for sending emails and second cron job for validating my application subscriptions.

I write one crontab file and write to two cronjob as follows:

2 * * * * path to mailCronjob mail.php
20 * * * * path to check my application's subscriptions sub.php

The problem is first cronjob is working fine. Mail will delivers fine, but the second cronjob is not working. I tried to run second job manually, its also working fine.

I am using command to set cronjob as:

crontab crontab_file

when I give command crontab -l it also shows both cronjob in command line.

I wanted to ask, am I missing something here, or what should I do to run those cronjobs.

I wanted to implement two cronjobs with different execution time. One cron job is for sending emails and second cron job for validating my application subscriptions.

I write one crontab file and write to two cronjob as follows:

2 * * * * path to mailCronjob mail.php
20 * * * * path to check my application's subscriptions sub.php

The problem is first cronjob is working fine. Mail will delivers fine, but the second cronjob is not working. I tried to run second job manually, its also working fine.

I am using command to set cronjob as:

crontab crontab_file

when I give command crontab -l it also shows both cronjob in command line.

I wanted to ask, am I missing something here, or what should I do to run those cronjobs.

I wanted to implement two cronjobs with different execution time. One cron job is for sending emails and second cron job for validating my application subscriptions.

I write one crontab file and write to two cronjob as follows:

2 * * * * path to mailCronjob mail.php
20 * * * * path to check my application's subscriptions sub.php

The problem is first cronjob is working fine. Mail will delivers fine, but the second cronjob is not working. I tried to run second job manually, its also working fine.

I am using command to set cronjob as:

crontab crontab_file

when I give command crontab -l it also shows both cronjob in command line.

I wanted to ask, am I missing something here, or what should I do to run those cronjobs.

您需要在配置文件的末尾添加一个空行

I wanted to implement two cronjobs with different execution time. One cron job is for sending emails and second cron job for validating my application subscriptions.

I write one crontab file and write to two cronjob as follows:

2 * * * * path to mailCronjob mail.php
20 * * * * path to check my application's subscriptions sub.php

The problem is first cronjob is working fine. Mail will delivers fine, but the second cronjob is not working. I tried to run second job manually, its also working fine.

I am using command to set cronjob as:

crontab crontab_file

when I give command crontab -l it also shows both cronjob in command line.

I wanted to ask, am I missing something here, or what should I do to run those cronjobs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM