LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 01-20-2013, 10:10 PM   #1
TheQuicken
LQ Newbie
 
Registered: Jan 2013
Distribution: Centos/RedHat/Rhel
Posts: 25

Rep: Reputation: Disabled
Print Window Shares dir > to file on Linux box


I trying to do the following:

connect from linux box to windows shares (DONE)
list contents of window share dir (DONE)
ls the contents of windows share dir and print txt file to a specific location on my linux box. --FAIL lol

I ideally want to write a script that when exucuted, will connect to the windows share/s, log in with username/passwd and then ls and print the output to a place of my choosing. (on my linux box).

little help? All my searching so far only seen people with problems trying to connect from Windows to Linux.

FYI, I'm using CENTOS.6.3


Or would it be easier to just run my batch files on windows, but have the output .txt file print to a share mounted from my linux box? Then I could just edit my webpage content path to read from that mounted file?

Last edited by TheQuicken; 01-20-2013 at 10:15 PM. Reason: afterthougt
 
Old 01-20-2013, 11:02 PM   #2
lykwydchykyn
Member
 
Registered: Mar 2006
Location: Tennessee, USA
Distribution: Debian, Ubuntu
Posts: 135

Rep: Reputation: 36
try:
Code:
smbclient //server/share -c ls > somefile.txt
 
Old 01-21-2013, 01:05 AM   #3
TheQuicken
LQ Newbie
 
Registered: Jan 2013
Distribution: Centos/RedHat/Rhel
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lykwydchykyn View Post
try:
Code:
smbclient //server/share -c ls > somefile.txt
Tried this, result was:

asked for windows share users passwd(accepted)
and just made a new file (somefile.txt) under my users / dir.

ls somefile.txt = somefile.txt
cat somefile.txt = Connection to 192.168.1.220 failed (Error NT_STATUS_HOST_UNREACHABLE)
Is this attempting to create a shortcut?

As it stands right now, I run a set of Batch.files on my Windows that > the output to a couple of .txt files in a List Folder I have mounted as a share. I have mounted the Windows share List folder on my linux box via /mnt/Winshares. My webpage has a couple Href// links to individual files in the List folder under apache/htdocs. I run a script to overwrite/update the apache/htdocs/List folder. I want to be able to just run the one script on the linux box, as opposed to 1)run batchfiles on windows 2)run script on linux.

One script would be nice lol.

Last edited by TheQuicken; 01-21-2013 at 01:06 AM. Reason: I don' t believe in proofreading...
 
Old 01-21-2013, 07:50 PM   #4
lykwydchykyn
Member
 
Registered: Mar 2006
Location: Tennessee, USA
Distribution: Debian, Ubuntu
Posts: 135

Rep: Reputation: 36
"Host unreachable" sounds like a connectivity issue. Any time you're doing a redirect, test it without the redirect first to see if the command actually outputs something useful.

How were you actually connecting before? smbclient or something else?
 
Old 01-21-2013, 11:34 PM   #5
TheQuicken
LQ Newbie
 
Registered: Jan 2013
Distribution: Centos/RedHat/Rhel
Posts: 25

Original Poster
Rep: Reputation: Disabled
Wink

Quote:
Originally Posted by lykwydchykyn View Post
"Host unreachable" sounds like a connectivity issue. Any time you're doing a redirect, test it without the redirect first to see if the command actually outputs something useful.

How were you actually connecting before? smbclient or something else?
smbclient. I'm running this 'test' on a VM, (VMware Workstation 9) I have full connectivity to the net/lan. I even installed a apache2 webserver, cloned it to a secondary user, installed NOIP DNS and I can connect via local and external net. (HTTP/SSH).

It it highly likely I'm not communicating clearly what I'm trying to do and with what lol.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting my Linux box to Small Business Server Shares TuxLives Linux - Networking 2 01-19-2009 09:43 AM
Linux box won't print across LAN to XP box LPT1 whynotlinux Linux - Networking 1 08-28-2006 10:36 AM
print text file to the console window, how? l.u Linux - Software 3 06-14-2005 02:54 PM
Password Message Box when accessing linux box from Window Machine mikeccs Linux - Networking 1 08-04-2004 05:47 AM
Samba access WIN XP shares from linux box rmanocha Linux - Software 8 10-24-2003 08:28 AM


All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration