public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Help with backup script
@ 2006-03-01 14:38 Paul
  2006-03-01 22:54 ` [gentoo-user] " Harry Putnam
  0 siblings, 1 reply; 11+ messages in thread
From: Paul @ 2006-03-01 14:38 UTC (permalink / raw
  To: gentoo-user

Hi,
I am probably missing the obvious here but how do I get a script to recognise 
a network usb2 disk?
I konqueror I can read and write using smb:// xxx.yyy.com but if I define the 
backup disk the same I get the error message that there is no such file or 
directory.

Thanks for any help
Paul
-- 
This message has been sent using kmail with gentoo linux
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-user]  Re: Help with backup script
  2006-03-01 14:38 [gentoo-user] Help with backup script Paul
@ 2006-03-01 22:54 ` Harry Putnam
  2006-03-02 12:20   ` Paul
  0 siblings, 1 reply; 11+ messages in thread
From: Harry Putnam @ 2006-03-01 22:54 UTC (permalink / raw
  To: gentoo-user

Paul <gentoo@appjaws.plus.com> writes:

> Hi,

> I am probably missing the obvious here but how do I get a script to
> recognise a network usb2 disk?  I konqueror I can read and write
> using smb:// xxx.yyy.com but if I define the backup disk the same I
> get the error message that there is no such file or directory.

The shell (that the script starts) doesn't know about smb protocol.
Konqueror has code that talks smb.
You might be able to script smbclient with expect or something but 
assuming you have this USB device setup as a windows share:

One way would be to mount the disk locally using cifs.  See 
`man mount.cifs' for details but the syntax looks like this:

>From /etc/fstab (This is all one line in fstab)
//harvey/harvey-c  /mnt/harvey-c cifs noauto,username=reader,\
credentials=/etc/samba/CifsCredentials

Those are `UNC' paths like you would use with smbclient. (But not
Kanqueror). 

A command line might look like:

  mount -t cifs -o user=reader%XXPASSWDXX //harvey/harvey-c /mnt/harvey-c

The directory /mnt/harvey-c has to be created ahead of time.
The user reader needs to have an account on that windows machine.

You'll need a windows user account username and password.  If you
don't use passwords for windows shares I think you can just leave out
the %SECRET_PASS, but I'm not sure exactly.

Once the device is mounted locally you can read/write to/from it in
scripting, then umount it at the end of the script.



-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: Help with backup script
  2006-03-01 22:54 ` [gentoo-user] " Harry Putnam
@ 2006-03-02 12:20   ` Paul
  2006-03-02 12:49     ` John Jolet
  2006-03-02 12:58     ` Harry Putnam
  0 siblings, 2 replies; 11+ messages in thread
From: Paul @ 2006-03-02 12:20 UTC (permalink / raw
  To: gentoo-user

On Wednesday 01 Mar 2006 22:54, Harry Putnam wrote:
snip
>
> One way would be to mount the disk locally using cifs.  See
> `man mount.cifs' for details but the syntax looks like this:
>
> From /etc/fstab (This is all one line in fstab)
> //harvey/harvey-c  /mnt/harvey-c cifs noauto,username=reader,\
> credentials=/etc/samba/CifsCredentials
>
> Those are `UNC' paths like you would use with smbclient. (But not
> Kanqueror).
>
> A command line might look like:
>
>   mount -t cifs -o user=reader%XXPASSWDXX //harvey/harvey-c /mnt/harvey-c
>
> The directory /mnt/harvey-c has to be created ahead of time.
> The user reader needs to have an account on that windows machine.
>
> You'll need a windows user account username and password.  If you
> don't use passwords for windows shares I think you can just leave out
> the %SECRET_PASS, but I'm not sure exactly.
>
> Once the device is mounted locally you can read/write to/from it in
> scripting, then umount it at the end of the script.
Thanks for the reply, I think I didn't make the problem clear enough.
I have a usb server running on my network with 2 external disks connected to 
it.  I can read and write to them using smb://lkg5f.homenet.com/DISK 2/ with 
no problems.
I need to mount these drives so that I can run a backup script to backup all 
of my gentoo system. I have tried smbmount and mount -t smbfs but even after 
reading man mount and smbmount I am still unclear as to the correct format.

paul
-- 
This message has been sent using kmail with gentoo linux
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: Help with backup script
  2006-03-02 12:20   ` Paul
@ 2006-03-02 12:49     ` John Jolet
  2006-03-02 14:23       ` Paul
  2006-03-02 12:58     ` Harry Putnam
  1 sibling, 1 reply; 11+ messages in thread
From: John Jolet @ 2006-03-02 12:49 UTC (permalink / raw
  To: gentoo-user

>>   mount -t cifs -o user=reader%XXPASSWDXX //harvey/harvey-c /mnt/ 
>> harvey-c
>>
>> The directory /mnt/harvey-c has to be created ahead of time.
>> The user reader needs to have an account on that windows machine.
>>
>> You'll need a windows user account username and password.  If you
>> don't use passwords for windows shares I think you can just leave out
>> the %SECRET_PASS, but I'm not sure exactly.
>>
>> Once the device is mounted locally you can read/write to/from it in
>> scripting, then umount it at the end of the script.
> Thanks for the reply, I think I didn't make the problem clear enough.
> I have a usb server running on my network with 2 external disks  
> connected to
> it.  I can read and write to them using smb://lkg5f.homenet.com/ 
> DISK 2/ with
> no problems.
> I need to mount these drives so that I can run a backup script to  
> backup all
> of my gentoo system. I have tried smbmount and mount -t smbfs but  
> even after
> reading man mount and smbmount I am still unclear as to the correct  
> format.
>
mount -t smbfs //lkg5f.homenet.com/DISK 2 /mnt/someplace

if the share is password protected, after the smbfs, add -o  
username=whatever,password=whatever

only root will be able to do this.  You might want to try to avoid  
spaces in your share names in the future...just makes things easier  
on the unix side.
> paul
> -- 
> This message has been sent using kmail with gentoo linux
> -- 
> gentoo-user@gentoo.org mailing list
>

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-user]  Re: Help with backup script
  2006-03-02 12:20   ` Paul
  2006-03-02 12:49     ` John Jolet
@ 2006-03-02 12:58     ` Harry Putnam
  1 sibling, 0 replies; 11+ messages in thread
From: Harry Putnam @ 2006-03-02 12:58 UTC (permalink / raw
  To: gentoo-user

Paul <gentoo@appjaws.plus.com> writes:

> I need to mount these drives so that I can run a backup script to backup all 
> of my gentoo system. I have tried smbmount and mount -t smbfs but even after 
> reading man mount and smbmount I am still unclear as to the correct format.

So are you saying the cifs commands posted don't work?

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: Help with backup script
  2006-03-02 12:49     ` John Jolet
@ 2006-03-02 14:23       ` Paul
  2006-03-02 14:37         ` John Jolet
  0 siblings, 1 reply; 11+ messages in thread
From: Paul @ 2006-03-02 14:23 UTC (permalink / raw
  To: gentoo-user

On Thursday 02 Mar 2006 12:49, John Jolet wrote:
snip
> mount -t smbfs //lkg5f.homenet.com/DISK 2 /mnt/someplace
>
> if the share is password protected, after the smbfs, add -o
> username=whatever,password=whatever
>
> only root will be able to do this.  You might want to try to avoid
> spaces in your share names in the future...just makes things easier
> on the unix side.
I hace tried the above commands with and without username and password but all 
I get is the usage message, no indication of an error.
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .

I was going to try Harry Putnam's solution of using cifs but it seems to me 
that the commands are exactly the same except for the file system.
Any other ideas please
Paul
-- 
This message has been sent using kmail with gentoo linux
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: Help with backup script
  2006-03-02 14:23       ` Paul
@ 2006-03-02 14:37         ` John Jolet
  2006-03-02 14:58           ` Paul
  0 siblings, 1 reply; 11+ messages in thread
From: John Jolet @ 2006-03-02 14:37 UTC (permalink / raw
  To: gentoo-user


On Mar 2, 2006, at 8:23 AM, Paul wrote:

> On Thursday 02 Mar 2006 12:49, John Jolet wrote:
> snip
>> mount -t smbfs //lkg5f.homenet.com/DISK 2 /mnt/someplace
>>
>> if the share is password protected, after the smbfs, add -o
>> username=whatever,password=whatever
>>
>> only root will be able to do this.  You might want to try to avoid
>> spaces in your share names in the future...just makes things easier
>> on the unix side.
> I hace tried the above commands with and without username and  
> password but all
> I get is the usage message, no indication of an error.
>
that message indicates you did not type it as shown.  they probably  
are the same, but I'm an old guy and this was before cifs... :)

if you NEED  a password but don't pass it, you'll get a permission  
denied error.  if you get usage, you mucked the syntax.  try it  
exactly as I had it above, but replacing the mountpoint at the  
end..and if it fails, cut and paste EXACTLY what you typed.

> I was going to try Harry Putnam's solution of using cifs but it  
> seems to me
> that the commands are exactly the same except for the file system.
> Any other ideas please
> Paul
> -- 
> This message has been sent using kmail with gentoo linux
> -- 
> gentoo-user@gentoo.org mailing list
>

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: Help with backup script
  2006-03-02 14:37         ` John Jolet
@ 2006-03-02 14:58           ` Paul
  2006-03-02 15:06             ` John Jolet
  2006-03-02 15:14             ` Hans-Werner Hilse
  0 siblings, 2 replies; 11+ messages in thread
From: Paul @ 2006-03-02 14:58 UTC (permalink / raw
  To: gentoo-user

On Thursday 02 Mar 2006 14:37, John Jolet wrote:
> On Mar 2, 2006, at 8:23 AM, Paul wrote:
> > On Thursday 02 Mar 2006 12:49, John Jolet wrote:
> > snip
> >
> >> mount -t smbfs //lkg5f.homenet.com/DISK 2 /mnt/someplace
Thanks for all your help  --  I now have it working, it appears that the line 
didn't like the space between DISK and 2. I created another share (with no 
spaces and it worked)

Thanks again
Paul
> > gentoo-user@gentoo.org mailing list

-- 
This message has been sent using kmail with gentoo linux
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: Help with backup script
  2006-03-02 14:58           ` Paul
@ 2006-03-02 15:06             ` John Jolet
  2006-03-02 15:14             ` Hans-Werner Hilse
  1 sibling, 0 replies; 11+ messages in thread
From: John Jolet @ 2006-03-02 15:06 UTC (permalink / raw
  To: gentoo-user


On Mar 2, 2006, at 8:58 AM, Paul wrote:

> On Thursday 02 Mar 2006 14:37, John Jolet wrote:
>> On Mar 2, 2006, at 8:23 AM, Paul wrote:
>>> On Thursday 02 Mar 2006 12:49, John Jolet wrote:
>>> snip
>>>
>>>> mount -t smbfs //lkg5f.homenet.com/DISK 2 /mnt/someplace
> Thanks for all your help  --  I now have it working, it appears  
> that the line
> didn't like the space between DISK and 2. I created another share  
> (with no
> spaces and it worked)
>
yes, i'm not surprised...which is why I added the comment about  
avoiding spaces.  if you can't avoid the space in the future,  
sometimes you can escape it (for instance, you'd do // 
lkg5f.homenet.com/DISK\ 2).  Not sure if smbmount will let you do  
that but if you can't change the share name, it's worth a try.
> Thanks again
> Paul
>>> gentoo-user@gentoo.org mailing list
>
> -- 
> This message has been sent using kmail with gentoo linux
> -- 
> gentoo-user@gentoo.org mailing list
>

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: Help with backup script
  2006-03-02 14:58           ` Paul
  2006-03-02 15:06             ` John Jolet
@ 2006-03-02 15:14             ` Hans-Werner Hilse
  2006-03-02 16:23               ` Paul
  1 sibling, 1 reply; 11+ messages in thread
From: Hans-Werner Hilse @ 2006-03-02 15:14 UTC (permalink / raw
  To: gentoo-user

Hi,

On Thu, 2 Mar 2006 14:58:33 +0000 Paul <gentoo@appjaws.plus.com> wrote:

> On Thursday 02 Mar 2006 14:37, John Jolet wrote:
> > On Mar 2, 2006, at 8:23 AM, Paul wrote:
> > > On Thursday 02 Mar 2006 12:49, John Jolet wrote:
> > > snip
> > >
> > >
> Thanks for all your help  --  I now have it working, it appears that
> the line didn't like the space between DISK and 2. I created another
> share (with no spaces and it worked)

I didn't notice this thread and the last answers earlier, therefore I
didn't react, but of course, spaces on command line must be escaped if
not meant to separate arguments. i.e., both of the following should
have worked, too:

> mount -t smbfs //lkg5f.homenet.com/DISK\ 2 /mnt/someplace
> mount -t smbfs "//lkg5f.homenet.com/DISK 2" /mnt/someplace

(of course, you can use ' - single apostrophe - instead of " here.)


-hwh
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: Help with backup script
  2006-03-02 15:14             ` Hans-Werner Hilse
@ 2006-03-02 16:23               ` Paul
  0 siblings, 0 replies; 11+ messages in thread
From: Paul @ 2006-03-02 16:23 UTC (permalink / raw
  To: gentoo-user

On Thursday 02 Mar 2006 15:14, Hans-Werner Hilse wrote:
> Hi,
>
> On Thu, 2 Mar 2006 14:58:33 +0000 Paul <gentoo@appjaws.plus.com> wrote:
> > On Thursday 02 Mar 2006 14:37, John Jolet wrote:
> > > On Mar 2, 2006, at 8:23 AM, Paul wrote:
> > > > On Thursday 02 Mar 2006 12:49, John Jolet wrote:
> > > > snip
> >
> > Thanks for all your help  --  I now have it working, it appears that
> > the line didn't like the space between DISK and 2. I created another
> > share (with no spaces and it worked)
>
> I didn't notice this thread and the last answers earlier, therefore I
> didn't react, but of course, spaces on command line must be escaped if
> not meant to separate arguments. i.e., both of the following should
>
> have worked, too:
> > mount -t smbfs //lkg5f.homenet.com/DISK\ 2 /mnt/someplace
> > mount -t smbfs "//lkg5f.homenet.com/DISK 2" /mnt/someplace
>
> (of course, you can use ' - single apostrophe - instead of " here.)
Thanks for the info, I did try the "\" but it didn't work. I have just tried 
the "" and it mounted just fine.
Thanks
Paul

-- 
This message has been sent using kmail with gentoo linux
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-03-02 16:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-01 14:38 [gentoo-user] Help with backup script Paul
2006-03-01 22:54 ` [gentoo-user] " Harry Putnam
2006-03-02 12:20   ` Paul
2006-03-02 12:49     ` John Jolet
2006-03-02 14:23       ` Paul
2006-03-02 14:37         ` John Jolet
2006-03-02 14:58           ` Paul
2006-03-02 15:06             ` John Jolet
2006-03-02 15:14             ` Hans-Werner Hilse
2006-03-02 16:23               ` Paul
2006-03-02 12:58     ` Harry Putnam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox