General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-19-2011, 11:19 PM
|
#1
|
LQ Newbie
Registered: Jun 2010
Posts: 0
Rep:
|
Shell script on copying files and folders from a linux server to a windows server
Hi,
I need a help in writing a SHELL SCRIPT for COPYING FILES AND FOLDERS FROM A LINUX SERVER TO A WINDOWS SERVER using WinSCP.
I have an IP address, username and a password to connect to the Linux server (using WinSCP). From there I am copying the files to the windows server. I want to do this automatically in a daily basis. Pls help me on this...
|
|
|
07-19-2011, 11:43 PM
|
#2
|
LQ Newbie
Registered: Jul 2011
Posts: 2
Rep:
|
Well it's my understanding that WinSCP is a program that runs on Windows and provides SFTP and FTP clients. So I would follow the documentation on the WinSCP site http://winscp.net/eng/docs/scripting for scripting. If you need assistance with Linux please explain your question in detail and describe exactly what you stuck on.
|
|
|
07-19-2011, 11:50 PM
|
#3
|
LQ Newbie
Registered: Jun 2010
Posts: 0
Original Poster
Rep:
|
Quote:
Originally Posted by jerryleem412
Well it's my understanding that WinSCP is a program that runs on Windows and provides SFTP and FTP clients. So I would follow the documentation on the WinSCP site http://winscp.net/eng/docs/scripting for scripting. If you need assistance with Linux please explain your question in detail and describe exactly what you stuck on.
|
Using winSCP, I can connect to the linux machine using the IP, username and password. I need a shell script, which can automatically connect to the linux machine and copy the files to the windows machine using SCP.
Last edited by nithin6034; 07-20-2011 at 12:12 AM.
|
|
|
07-20-2011, 12:12 AM
|
#4
|
LQ Newbie
Registered: Jul 2011
Posts: 2
Rep:
|
WinSCP is a client, it's not a server. So a shell script initiated from the Linux machine isn't going to be able to connect to WinSCP. Your best bet would be setting up a script or a batch file on the Windows PC and initiate the connection using your WinSCP client. With that said I wouldn't recommend running a FTP server on Windows unless you have a really good firewall or it's on a private network. Now if your hell bent on running a Linux script to transfer files another option would be to use Samba and setup file share(s) on the Windows server. That would be a relativly simple thing to do. Just create a symbolic link to your Windows PC file share then set up a shell cript to copy files into that folder(s).
|
|
|
07-20-2011, 12:59 AM
|
#5
|
LQ Newbie
Registered: Jun 2010
Posts: 0
Original Poster
Rep:
|
I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine.
for example : On July 20, the file name will be 20.txt and it should be copied to windows
On July 21, It will become 21.txt and it also should be copied.
I need a script to work this
Last edited by nithin6034; 07-20-2011 at 01:10 AM.
|
|
|
07-20-2011, 08:59 AM
|
#7
|
Moderator
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,960
|
Moved: This thread is more suitable in <General> and has been moved accordingly to help your thread/question get the exposure it deserves.
|
|
|
All times are GMT -5. The time now is 11:17 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|