• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Copy Directory to another local server

Participant ,
Feb 20, 2007 Feb 20, 2007

Copy link to clipboard

Copied

Hi gents and ladies.
I want to copy a folder and its files from my machine to another server in a schedule task...What are the steps to follow ? I dont want to use cfftp...Any suggestions ?
TOPICS
Advanced techniques

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 20, 2007 Feb 20, 2007

Copy link to clipboard

Copied

The first question is where is the other server? If it's on a local unc path or mounted you might want to consider letting the operating system do what it does best by using a cfexecute to issue a system level directory xcopy.

If it's a large copy set the timeout to 0 so that cfexecute can return immediately, otherwise, if you want to capture the output (as below), set the timeout to the appropriate amount. There are other parameters available for XCOPY, just type XCOPY /? in a command prompt.

<cfparam name="myExecute" default="">
<cfexecute
name = "xcopy"
arguments = "\\server\share\path1\path2 c:\destination /S /R /Y /I" variable="myExecute"
timeout = "120" />

<cfdump var="#myExecute#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 20, 2007 Feb 20, 2007

Copy link to clipboard

Copied

It is on another windows 2003 box...I tried this :
arguments = "\\bt2bcm\d$\cfusionmx\wwwroot \\bt2bdssc\vozturk$\Denemeler\ /S /R /Y /I"

The output = 0 File(s) copied

Why is that ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 20, 2007 Feb 20, 2007

Copy link to clipboard

Copied

sorry copying will be between 2 servers,,,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 22, 2007 Feb 22, 2007

Copy link to clipboard

Copied

Hey emmim44-

If you want to stick to CF, have you tried setting up a mapping to the destination server on your machine (assuming "another local server" means it's on your local network) and just using CFFILE (action=copy or move) to do the transfers?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 22, 2007 Feb 22, 2007

Copy link to clipboard

Copied

I did dude..mapping....even xcopy dont copy the folders itself and its files.. xcopy sucks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 22, 2007 Feb 22, 2007

Copy link to clipboard

Copied

If I remember correctly, XCOPY needs exact files specification(s), not just a directory, for source file(s). Like "C:\myfiles\*.*". The distination may be a directory, if exact copy is needed.

Another possibility is that the account CF is running under cannot access network or/and one of shares. Verify that you can copy a single file using CFFILE between these two shares.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

Yes cffile works....the thing with xcopy is :
If I have a directory and some files in it (C:\g\*.* ), it wont create a directory "g" in the destination place..it just copy the files in that "g" folder....I need to copy the directory and its files to the destination like the way windows is ....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

Use the /E attribute in Xcopy also to have it create directory structure if it doesn't already exist.

You also might want to look at using Robocopy from the Windows recource kit. It has alot more features to move files between servers.

http://www.ss64.com/nt/robocopy.html
http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=9D467A69-57FF-4AE7-96EE-B18C...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

I am using it but it does copy only the folder not the files in it..I need all the files within that folder and folder to copy into target destination...

Xcopy c:\g\*.* I:\ /e /t /y

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

LATEST
You have to use UNC paths (\\server\share\directory\) instead of mapped logical drives. Mappings are attached to a user account. Therefore, they may not exist from the point of view of the account the CF is running.

I think your very first example will work, if you add wildcard files specification for the source and the directory tree copy flag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation