How to move files on remote windows using a linux command
I am newbie to linux, I need a linux command to move set of files from one folder to another on windows box remotely. I want to know is it really possible through script/command.
I tried smbclient, when i use it for moving files I have to perform two step process: 1. copy remote windows files from folder1 to linux box first. - using mget 2. then copy those files to folder2 on remote windows - using mput. because of the above process, when I have large files it becomes too much time consuming and nullifies the purpose of speed in my automation process. So I need a command/script to speed up my process and avoid copy over of files from linux to windows. |
You appear to be using ftp to perform a simple move operation.
ftp is a data transfer protocol and so transfers all the data! Provided you have some kind of network connection, you could just issue a command to be carried out by the remote machine which will do all the work. One possibility - which provides a GUI interface - is to use a program called VNC. This would allow you to rename folder1 to folder2 using a Windows command. VNC is available in Linux & Windows Or are your requirements more complex? |
Hello and welcome to the forum :)
Also, just as a suggestion, you might want to change your username using the instructions at the top of the page here, lest your email inbox ends up with a boatload of SPAM in the very near future. ;) Regards... |
More information is needed, like version of Linux.
I would use scp, since it is encrypted and less headaches then nfs or samba. Hopefully you are running ssh on whatever version of Linux you are using...? https://garron.me/en/articles/scp.html |
You need to provide more details. What services is the Windows box hosting? Is it running an ftp server? ssh server? Are the files/directories being shared?
|
Try WinSCP, check it out. You can copy files from Windows to Linux or Linux to Windows.
But depending on the amount of data you're copying, WinSCP might be a bit slower. |
Quote:
|
Here are more details about my query:
I want to move files under folder1 content to backup folder on a remote windows box(app hosting machine) from a linux box(build machine) in an automated way(I can't use any GUI, it should be scripted so that the script can be scheduled to run). This is only one step out of my automation process that I am trying to do: 1. Get the new files from repository and some manipulation of them in linux box(build box) 2. stop the windows app service. 3. move existing content to a backup folder(on targeted windows box) - question is related to this step. 4. move files prepared in step.1 to targeted windows box. 5. Restart windows app service. It's a typical scenario, Usually all of our prod app hosting and build/code deployment boxes are that of linux so automation scripts for moving and updating stuff was simple. but in this scenario I have a app hosting box as a windows but build machine that i have to use is a linux(common build box). I have large files under folder1 so if I copy from windows(from folder1) to linux and then from linux to windows back(into backup) it's taking long time. So I want to move those files on folder1 to backup on windows box itself using a command from linux box. I have those folders shared on windows box and ftp running on that windows box. Hope this helps in providing better picture on my requirement. |
So it sounds like you're accessing the windows box through ftp?
Look into the lftp tool, it's built for accessing ftp servers from within a script, and it supports "mv" which can be used to move or rename files on the server. |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 10:24 PM. |