How to move files on remote windows using a linux command
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
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.
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
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.
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?
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...
Thanks for providing the instructions link to change username, I was looking for that to avoid spam. I requested to change my userid through contact us(hopefully it will be done quickly). My initial thought while creating username was that I'll be provided with an option to have a display name for my posts and my username will not be used.
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.
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.
I am presently using smbclient to connect to the windows box not ftp.
I am presently using smbclient to connect to the windows box not ftp.
You literally just said that the windows box was running ftp, but either way...can't you just mount the windows share on the linux box using cifs then?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.