I want to perform a task with a php file, (updating a feed) which I want to do automatically once a day. I DON'T want to have to load the file in a browser by hand. The file itself could be anything (very small and fast) but it needs to be run every day without using Cron jobs
Asked
Active
Viewed 1,082 times
0
-
3is there any specific reason for run the file without cron job ? – Arun Feb 02 '15 at 06:39
-
1Try bash script then – Vick Feb 02 '15 at 06:39
-
i don't have cpanel access to do cron job – Velangini Reddy Feb 02 '15 at 07:17
-
Check this thread: http://stackoverflow.com/questions/7332804/run-a-php-file-in-a-cron-job-using-cpanel?rq=1 – Mikrobi Feb 02 '15 at 08:58
-
@Mikrobi: What does that link have to do with the requirement to schedule a script without using a cron job? – Stefan Aug 04 '15 at 12:23
2 Answers
0
If you're on a Windows machine, you can use a scheduled task (here are the instructions for Windows 7, but Google "run scheduled task " to find similar pages for other versions). It has much the same options as Cron, with a simple interface.
Two other possible hacks:
- Have the URL for the feed itself be a PHP script that updates the feed and outputs it directly. Then you could but a cache in front of that URL so it only refreshes once a day (for instance the free level of Cloudfare).
- Have the PHP script create a webpage that refreshes itself once a day, using the meta refresh tag. Then open a browser window and never close it.

Joel
- 237
- 3
- 9
-
"scheduled task" is basically cron. just a different name for essentially the same thing... – Marc B Jun 12 '15 at 15:10
-
0
If the page you have created is exposed to network, you could theoretically run a cron-job from another machine on the said network and call a curl to the page:
curl http://server/yourphp

TomasH
- 148
- 1
- 7