Linux - Newbie This 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.
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.
|
|
04-27-2012, 05:14 AM
|
#1
|
Member
Registered: Apr 2011
Posts: 63
Rep:
|
Copying files from linux to windows using script.
I am doing some build on Linux machine after the build I need to copy those files to windows. I need to do this using script. How can i achieve this. I have samba server.
If i have samba i can manually copy files by accessing Linux machine as \\linux_machine. This i need to do automatically
I heard something like mapping windows folder in linux and copying files there.
anybody has done this or has idea how to do that?
|
|
|
04-27-2012, 05:15 AM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,232
|
it looks like a simple copy. what have you tried?
|
|
|
04-27-2012, 05:16 AM
|
#3
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
Do you want the script to run on Windows or Linux?
|
|
|
04-27-2012, 05:23 AM
|
#4
|
Member
Registered: Apr 2011
Posts: 63
Original Poster
Rep:
|
thanks for the quick reply
Basically i am interested in mapping windows folder to linux nachine.
i am running this from linux.
@catkin i need the script
|
|
|
04-27-2012, 05:28 AM
|
#5
|
Senior Member
Registered: Mar 2012
Posts: 1,882
|
Code:
cp $files //winbox/share
Last edited by descendant_command; 04-27-2012 at 05:30 AM.
Reason: doh! slashes
|
|
|
04-27-2012, 05:31 AM
|
#6
|
Member
Registered: Apr 2011
Posts: 63
Original Poster
Rep:
|
i tried
scp -r install.log username@ip_address:.
i got connection lost error
|
|
|
04-27-2012, 05:33 AM
|
#7
|
Member
Registered: Apr 2011
Posts: 63
Original Poster
Rep:
|
//winbox is computer name rt ?
|
|
|
04-27-2012, 05:34 AM
|
#8
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,232
|
you do not need scp, but a simple copy, just mount the drive before. it works on both linux and windows, only the syntax will differ a bit.
cp -r <source> <dest>
and either source or dest is mounted.
|
|
|
04-27-2012, 05:41 AM
|
#9
|
Member
Registered: Apr 2011
Posts: 63
Original Poster
Rep:
|
how can i mount windows folder in linux
|
|
|
04-27-2012, 05:43 AM
|
#10
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,232
|
|
|
|
04-27-2012, 05:46 AM
|
#11
|
Senior Member
Registered: Mar 2012
Posts: 1,882
|
Yeah sorry, ignore me ... been using windows today...
|
|
|
04-27-2012, 05:55 AM
|
#12
|
Member
Registered: Apr 2011
Posts: 63
Original Poster
Rep:
|
getting this error while test connection
session setup failed: NT_STATUS_LOGON_FAILURE
|
|
|
04-27-2012, 06:03 AM
|
#13
|
Member
Registered: Apr 2011
Posts: 63
Original Poster
Rep:
|
looks like samba is not there
i check and get back to you guys.. Thanks for help
|
|
|
04-27-2012, 06:11 AM
|
#14
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Put a .credentials file in your HOME directory and refer to it in your /etc/fstab entry options. If you use the uid, gid & user options, you can even mount the directory as a normal user.
Check that you firewall isn't blocking the ports that the samba client uses.
Run "smbclient -l <HOSTNAME>" and see if the windows shares are listed.
The domain/workgroup should match. I'm afraid I don't know where to configure it if you only use a client, but you could an entry in your .credentials file. See man mount or man cifs for details.
You could also use smbclient as a smb ftp client for your script, instead of mounting.
----
To preserve file ownership and permissions, storing a tar ball on the Windows host would be prefered, if you aren't using the files.
Last edited by jschiwal; 04-27-2012 at 07:24 AM.
|
|
|
All times are GMT -5. The time now is 06:02 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
|
|