B
B
B1ackGh0st2014-10-03 04:31:44
linux
B1ackGh0st, 2014-10-03 04:31:44

How to download XML file via php using cron at specific time?

How to run a php script to download an XML file (and how to download the file) using cron at 6:00 and 18:00?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2014-10-03
@CTAKAH4uK

$xml = file_get_contents("http://URL_XML.xml");
file_put_contents("PATH/LOCAL_FILENAME.xml" , $xml);

crontbab -e
0 6,18  * * * /path/script.php

A
Alexander Taratin, 2014-10-03
@Taraflex

masterhost.ru/support/doc/cron
For a simple download, you can do with wget or curl
rus-linux.net/nlib.php?name=/MyLDP/internet/wget.html
proft.me/2013/08/17/spravochnik-po -commandam-wget-i-curl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question