php - How to set up a cronGet the solution ↓↓↓
I have this PHP script which updates my database when the webpage is visited via https://......
database connection file.....
How can I set a cronjob to visit this every 24hours?
I entered these commands but didn't work /home/xxxxx/public_html/cron.php and /home/xxx/public_html/cron.php
and I entered the web address directly still didn't work.
If you're trying to setup a cronjob in linux to call your php file every 24 hours here's how you do it.
In your terminal type
contab -e, select your preferred editor and at the end of the file type:
0 0 * * * php /path/to/your/script.php
This will call that script every day at midnight (your server's time). Also be careful, as crontab runs under your currently logged user and running these commands as
root might expose your server to some dangers.
Share solution ↓
Link To Answer People are also looking for solutions of the problem: filter_sanitize_string
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.