[HELP] Copy a txt file between two remote servers

mullet

Junior Member
Joined
Jun 21, 2011
Messages
130
Reaction score
26
Hey guys

Been searching for awhile without any luck.

I need to copy a single text file from a web site, lets call it example.com/file1.txt to my hosting account, lets call that personaldomain.com/

This needs to happen hourly so I presume its going to need a cron job (I will do this via cpanel) Additionally, it needs to overwrite the existing file1.txt every time it copies. If anyone knows the code to do this it will be much appreciated.

Please can you help me out?

Thanks
 
hey, try this one, works well...

save code to a php file and cron it

Code:
<?php

copy("http://www.your-target.com/123.txt","/local/web/dir/temp.txt");

 ?>
 
Back
Top