Gentoo Archives: gentoo-user

From: Harry Putnam <reader@×××××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Help with backup script
Date: Wed, 01 Mar 2006 22:59:49
Message-Id: 873bi1vkrt.fsf@newsguy.com
In Reply to: [gentoo-user] Help with backup script by Paul
1 Paul <gentoo@××××××××××××.com> writes:
2
3 > Hi,
4
5 > I am probably missing the obvious here but how do I get a script to
6 > recognise a network usb2 disk? I konqueror I can read and write
7 > using smb:// xxx.yyy.com but if I define the backup disk the same I
8 > get the error message that there is no such file or directory.
9
10 The shell (that the script starts) doesn't know about smb protocol.
11 Konqueror has code that talks smb.
12 You might be able to script smbclient with expect or something but
13 assuming you have this USB device setup as a windows share:
14
15 One way would be to mount the disk locally using cifs. See
16 `man mount.cifs' for details but the syntax looks like this:
17
18 >From /etc/fstab (This is all one line in fstab)
19 //harvey/harvey-c /mnt/harvey-c cifs noauto,username=reader,\
20 credentials=/etc/samba/CifsCredentials
21
22 Those are `UNC' paths like you would use with smbclient. (But not
23 Kanqueror).
24
25 A command line might look like:
26
27 mount -t cifs -o user=reader%XXPASSWDXX //harvey/harvey-c /mnt/harvey-c
28
29 The directory /mnt/harvey-c has to be created ahead of time.
30 The user reader needs to have an account on that windows machine.
31
32 You'll need a windows user account username and password. If you
33 don't use passwords for windows shares I think you can just leave out
34 the %SECRET_PASS, but I'm not sure exactly.
35
36 Once the device is mounted locally you can read/write to/from it in
37 scripting, then umount it at the end of the script.
38
39
40
41 --
42 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Re: Help with backup script Paul <gentoo@××××××××××××.com>