Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 01-07-2008, 02:33 PM
jonathan184 jonathan184 is offline
Hatchling Croc
 
Join Date: Jan 2008
Posts: 1
Default What is the full path to use copy command in cron with php

What is the full path to use copy command in cron with php

Hi basically i created a php script to copy the contents from a folder and copy to the destination.

This is the script

PHP Code:
<?PHP

# Used to copy stats from the stats folder over to the domain account 
$fc=file("stats_config.txt");
//open same file and use "w" to clear file
$f=fopen("stats_config.txt","r");
//loop through array using foreach
foreach($fc as $line) {
//splits the source and destination by space
$lines2 preg_split('/\s+/'$line);
 
copy($lines2[0], $lines2[1]);
echo 
"copy of stat files from $lines2[0] is completed \n";
   }
fclose($f);
?>


stats_config file

contains lines of the source destination
so it is like /tmp/dir/* /public_html/domain/dir

So where am i going wrong? could somebody please help me
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 02:09 PM.

 
Forum SEO by Zoints