Reputation: 31
I would like to create a cron job to download an xml file daily at midnight. I want to overwrite any pre-existing file as well.
I tried
1 0 *** usr/bin/wget http://ace-tv.xyz:25461/xmltv.php?username=xxxx&password=xxxx --output-file=/home/username/myxmlfile.xml
I get a 200 ok for connecting...but nothing downloads.
I think the problem has something to do with the request coming from a php server and I'm not familiar with wget or curl enough to figure it out.
If I paste the URL into a browser the xml schema shows up and I can right click and do "save as" but I need this done by cron.
Any help, greatly appreciated.
Upvotes: 2
Views: 1177
Reputation: 279
For this purpose there is "--output-document=.." option:
1 0 *** usr/bin/wget --output-document=/home/username/myxmlfile.xml "http://ace-tv.xyz:25461/xmltv.php?username=xxxx&password=xxxx"
Also please note that you need to use URL string in quotes if it contains characters like "&"
Upvotes: 2