Link to home
Start Free TrialLog in
Avatar of sarasotamac
sarasotamacFlag for United States of America

asked on

Script/command to copy File Daily

Need a script or command to copy a file daily and move it to a directory on another server. The script needs to only copy the most recently created file in the directory.

Any ideas how to make this happen?
SOLUTION
Avatar of Santosh Gupta
Santosh Gupta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Kash
Kash
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sarasotamac

ASKER

billprew, this is going to only copy the newest file, correct?
Kash, I was thinking of robocopy, as I have used it for large data migrations previously. My only concern is getting it to only move the newest file in the directory.
if I were you, i would create a PS scripts which would take inputs on how to proceed with data copy. It should not be that hard to create one with couple of hours on hand.

with regards to robocopy, you can modify the selection (files) to copy >>> http://technet.microsoft.com/en-us/library/cc733145.aspx
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks everyone, I took a little from everyone's answers.
Avatar of Bill Prew
Bill Prew

Welcome.

~bp