Can't make crontab work

I am new to Linux and Ubuntu and I rarely have to use it. I'm trying to make this PHP script run every minute using cron, but I would like to do some tests first.

I created an empty file /var/www/html/

under the name test

. I launched terminal:

sudo crontab -e

      

And added this line:

0 * * * * rm /var/www/html/test

      

Then they saved it and went out. He said: Installing a new Crontab "

Nothing happened. Then I created a bfile.sh file containing:

#!/bin/sh 
rm /var/www/html/test

      

and added the following to the crontab:

0 * * * * bash /var/www/html/bfile.sh

      

Still nothing happened.

What do I need to do to see anything coming from the crontab? By the way, I checked and the service is running

+3


source to share


2 answers


0 * * * *

basically says, "Run this at the 0th minute of every hour."



If you need a cron to run your command every minute, do * * * * *

.

+3


source


0 * * * *

is performed once every 1 hour. If you want to run every minute it should be*/1 * * * *



You can also check the file / var / log / cron for any errors

+3


source







All Articles