Skip to Main Content
Using Samba
book

Using Samba

by Robert Eckstein, David Collier-Brown, Peter Kelly
November 1999
Beginner to intermediate content levelBeginner to intermediate
413 pages
16h 7m
English
O'Reilly Media, Inc.
Content preview from Using Samba

Magic Scripts

The following options deal with magic scripts on the Samba server. Magic scripts are a method of running programs on Unix and redirecting the output back to the SMB client. These are essentially an experimental hack. However, some users and their programs still rely on these two options for their programs to function correctly. Magic scripts are not widely trusted and their use is highly discouraged by the Samba team. See Table 8.2 for more information.

Table 8-2. Networking Configuration Options

Option

Parameters

Function

Default

Scope

magic script

string (fully-qualified filename)

Sets the name of a file to be executed by Samba, as the logged-on user, when closed.

None

Share

magic output

string (fully-qualified filename)

Sets a file to log output from the magic file.

scriptname.out

Share

magic script

If the magic script option is set to a filename and the client creates a file by that name in that share, Samba will run the file as soon as the user has opened and closed it. For example, let’s assume that the following option was created in the share [accounting]:

[accounting]
	magic script = tally.sh

Samba continually monitors the files in that share. If one by the name of tally.sh is closed (after being opened) by a user, Samba will execute the contents of that file locally. The file will be passed to the shell to execute; it must therefore be a legal Unix shell script. This means that it must have newline characters as line endings instead of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Using Samba, Second Edition

Using Samba, Second Edition

Jay Ts, Robert Eckstein, David Collier-Brown
Linux: Powerful Server Administration

Linux: Powerful Server Administration

Uday Sawant, Oliver Pelz, Jonathan Hobson, William Leemans

Publisher Resources

ISBN: 1565924495Supplemental ContentCatalog PageErrata