简体   繁体   中英

Multiple cron jobs not working

I am new to cron jobs.

The first cron job is running, but the second is not running.

   /usr/bin/php -q /home/domain/public_html/cronjob_posting.php

   /usr/bin/php -q /home/domain/public_html/cronjob_deletepost.php

Please help me.

You can combine multiple jobs by adding them to cron in the following way:

1) personally I prefer editing in gedit

sudo gedit ~/.profile

2) Add or edit these 2 lines

export VISUAL="gedit"
export EDITOR="gedit"

3) logout and login

4) Then in terminal:

crontab -e

5) Add these lines:

0 0 * * * /home/domain/public_html/cronjob_posting.php
0 0 * * * /home/domain/public_html/cronjob_deletepost.php

[Every day at 0:00 AM the server will run these scripts]

6) Then check if everything is there:

crontab -l

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