Automatic file transfer (daily)
Is it possible to automaticly download xml files from one server to another server on a daily basis with PHP?
The goal is to create a webapplication in CakePHP which makes use of an xml report that comes from a online accountingserver.
开发者_如何学PythonSo it can be done using a cronjob? But is cron supported with PHP?
Where can i configure that cronjob?
What kind of code should i write to get the file from the accountingserver in the first place?
Yes, you can create a PHP script that will download the data from the second server and then call it from using a cron job. Cron jobs allow you to run code at specific times. More info on that here.
It would probably look something like this:
0 0 * * * php path/to/file.php
This basically tells it to run file.php at minute 0, hour 0, every day, every month.
Surely you can.
You write a PHP
program that does this transfer once, when called. Then we run that program automatically every day at a fixed time by setting up a cron
job.
精彩评论