Jump to content

Copy Function ...


MrWho

Recommended Posts

Hey Guys,

 

I need some help ...

 

I need script that will copy files from one local server to another ( hardrive/mounted share)

I have something like this in PERL .. if anyone needs it ... but my PHP knowledge and google a temps didn't help ...

 

 

Script copies all PNG files from Folder A to Folder B + it appends actual date ...

 


use POSIX;
use File::Copy;
use File::Basename;
chdir "//Applications/XAMPP/xamppfiles/htdocs/app/webroot/img"
   or die "Wait for Automation then run script $!\n" ;

for my $file (<*.png>)
  { my ($name,$path,$suffix) = fileparse($file,".png") ;
    my $datestamp = strftime("%m_%d_",localtime) ;
    copy $file,"//Users/ladmin/Desktop/graphs/$datestamp$name$suffix"
      or warn "Cannot copy $file $!\n" ;
  
}

Link to comment
https://forums.phpfreaks.com/topic/182819-copy-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.