LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-29-2008, 04:33 PM   #1
petros08
LQ Newbie
 
Registered: Oct 2008
Posts: 3

Rep: Reputation: 0
smbfs


Hi All
I'm trying to back up a linux mail server to a windows share.
I want to use mount_smbfs to do it. I can connect manually and copy the file but I wanted ti try to write a script to automatically do it.
How can I get mount_smbfs to do that?

Any ideas?

P.S. If I do mount_smbfs -I 192.168.0.12 //pablo@server1/backup /mnt/back
up it works fine, but that's manual.

THanks for any help.
 
Old 10-29-2008, 06:26 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354


What part of that do you want to automate? If you just want a command that does that, and only that, put
Code:
#!/bin/bash
mount_smbfs -I 192.168.0.12 //pablo@server1/backup /mnt/back
in a file, make it executable, and run it when you wish.

You can also use the alias functionality of bash and, if you want more flexibility, look into the autofs system for automatically mounting cifs files as needed. Once that's set up, a simple reference to /mnt/back (e.g., a ls /mnt/back) will mount the remote file system and make it available to the command needing it.
 
Old 10-30-2008, 01:50 PM   #3
petros08
LQ Newbie
 
Registered: Oct 2008
Posts: 3

Original Poster
Rep: Reputation: 0
smbfs

Sorry, my mistake. I forgot to mention one thing. The share has a password on it. When I run the command manually, it prompts me for that password. My issue is trying to automate it so that it takes care of the password issue as well.
 
Old 10-30-2008, 08:05 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Try mount_smbfs -I 192.168.0.12 //pabloassword@server1/backup /mnt/back which leaves it in clear text or look into using a .smbpsw file and referencing it with the -P option. (I'm assuming that the [b]mount_smbfs{/b] script you're using is just invoking the smbclient command, and that the options are the same.)

That being said, have you looked at the man file for the smbclient command?

<edit> All the above is from memory, and may not be accurate. Sorry, it's been a while since I've used samba.</edit>

Last edited by PTrenholme; 10-30-2008 at 08:08 PM. Reason: Added caveat
 
Old 11-05-2008, 04:52 PM   #5
petros08
LQ Newbie
 
Registered: Oct 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Smbfs

Thanks for the input. I eventually got it going by using the command
"mount_smbfs -N -I ip.address.of.server //pablo@server1/backup /mnt/backup" in a script and adding the file .nsmbrc to the root directory with the following contents

[SERVER1]
charsets=koi8-r:cp866
addr=ip.address.of.server

[SERVER1:PABLO]
password=password
 
  


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
smbfs issues... jbrashear Debian 1 06-21-2005 06:57 AM
debian, smbfs rickets Linux - Software 2 09-10-2004 08:35 AM
autofs+smbfs=??? bdp Linux - General 5 09-19-2003 02:14 PM
smbfs ljames Slackware 2 06-01-2003 08:26 PM
smbfs hfawzy Linux - General 1 04-01-2003 08:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:52 AM.

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
Open Source Consulting | Domain Registration