Solved

How to auto copy files between Windows servers?

Posted on 2006-11-30
8
1,683 Views
Last Modified: 2008-02-07
There is plain text file on server A, which is updated serveral times every day. There is a SQL Server scheduled job on server B reads the text file and populates the database. Both servers are running Windows. Now the schedule job fails to read the text file on the other server and the error message says "access denied".

What I want to do is to copy the plain text file from server A to server B automatcially. Is there a way to do this in batch file?? Thank you for your help!  
0
Comment
Question by:iLvChopin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 18

Expert Comment

by:Sam Panwar
ID: 18050886
Hi iLvChopin,

If you want to copy text file from A serve to B server then you have to create VPN to connect both server so A server connect to B server. Access denied means you have not permission on that computer so please create VPN through the ROUTING AND REMOTE ACCESS and after that run schedule your problem should be resolve.

-ABS
0
 

Author Comment

by:iLvChopin
ID: 18051104
The sql scheduled job on B server is running under the admin account which also has full access to A server. I don't understand why the access is denied when the scheduled job tries to read the text file.

Is there a way to copy the text file from server A to server B using batch commands? Something like:

@echo off
copy c:/text.csv@ServerA c:/docs@ServerB
0
 
LVL 18

Expert Comment

by:Sam Panwar
ID: 18051314
Hi,

You can use xcopy for it is best.
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 18

Accepted Solution

by:
Sam Panwar earned 125 total points
ID: 18051482
Hi Abs_jaipur,
You can use XCOPY for it . Its best way to copy file, we  are also usinf this.

Create a .bat file for xcopy command through the notepad and put in to schedule
xcopy help
http://www.computerhope.com/xcopyhlp.htm#03

If you all access then create VPN its best way if you get permission access denied. Or map drive.


-ABS
0
 

Author Comment

by:iLvChopin
ID: 18054073
thanks and i will try the above options. Will give you an update later. thanks.
0
 
LVL 1

Assisted Solution

by:hubtech
hubtech earned 125 total points
ID: 18058760
I would suspect that the read access error may have been caused by the process that writes to the file having it locked.  I suggest that you want to initiate the batch file to copy the text file when the update process completes.  You can use a 'net use' command in a batch script to map a drive on the destination system and then copy the file over.  Here's an example:

  net use M: \\<computer\share> /persistent: no
  copy \srcdir\textfile.txt M:\destdir\textfile.txt

You can specify connection credentials if you need to on the 'net use' command line with the /USER switch.

Also try this for more information on mapping a drive from the command line (or batch script):

  net use /?

... hubtech
0

Featured Post

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question