Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.