<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<refentry id="smbtar">

<refmeta>
	<refentrytitle>smbtar</refentrytitle>
	<manvolnum>1</manvolnum>
</refmeta>


<refnamediv>
	<refname>smbtar</refname>
	<refpurpose>shell script for backing up SMB/CIFS shares 
	directly to UNIX tape drives</refpurpose>
</refnamediv>

<refsynopsisdiv>
	<cmdsynopsis>
		<command>smbtar</command>
		<arg choice="req">-s server</arg>
		<arg choice="opt">-p password</arg>
		<arg choice="opt">-x services</arg>
		<arg choice="opt">-X</arg>
		<arg choice="opt">-d directory</arg>
		<arg choice="opt">-u user</arg>
		<arg choice="opt">-t tape</arg>
		<arg choice="opt">-t tape</arg>
		<arg choice="opt">-b blocksize</arg>
		<arg choice="opt">-N filename</arg>
		<arg choice="opt">-i</arg>
		<arg choice="opt">-r</arg>
		<arg choice="opt">-l loglevel</arg>
		<arg choice="opt">-v</arg>
		<arg choice="req">filenames</arg>
	</cmdsynopsis>
</refsynopsisdiv>

<refsect1>
	<title>DESCRIPTION</title>

	<para>This tool is part of the <ulink url="samba.7.html">
	Samba</ulink> suite.</para>

	<para><command>smbtar</command> is a very small shell script on top 
	of <ulink url="smbclient.1.html"><command>smbclient(1)</command></ulink> 
	which dumps SMB shares directly to tape. </para>
</refsect1>

<refsect1>
	<title>OPTIONS</title>

	<variablelist>
		<varlistentry>
		<term>-s server</term>
		<listitem><para>The SMB/CIFS server that the share resides 
		upon.</para></listitem>
		</varlistentry>


		<varlistentry>
		<term>-x service</term>
		<listitem><para>The share name on the server to connect to. 
		The default is "backup".</para></listitem>
		</varlistentry>
		
		
		<varlistentry>
		<term>-X</term>
		<listitem><para>Exclude mode. Exclude filenames... from tar 
		create or restore. </para></listitem>
		</varlistentry>



		<varlistentry>
		<term>-d directory</term>
		<listitem><para>Change to initial <parameter>directory
		</parameter> before restoring / backing up files. </para></listitem>
		</varlistentry>



		<varlistentry>
		<term>-v</term>
		<listitem><para>Verbose mode.</para></listitem>
		</varlistentry>



		<varlistentry>
		<term>-p password</term>
		<listitem><para>The password to use to access a share. 
		Default: none </para></listitem>
		</varlistentry>


		<varlistentry>
		<term>-u user</term>
		<listitem><para>The user id to connect as. Default: 
		UNIX login name. </para></listitem>
		</varlistentry>



		<varlistentry>
		<term>-t tape</term>
		<listitem><para>Tape device. May be regular file or tape 
		device. Default: <parameter>$TAPE</parameter> environmental 
		variable; if not set, a file called <filename>tar.out
		</filename>. </para></listitem>
		</varlistentry>


		<varlistentry>
		<term>-b blocksize</term>
		<listitem><para>Blocking factor. Defaults to 20. See
		<command>tar(1)</command> for a fuller explanation. </para></listitem>
		</varlistentry>


		<varlistentry>
		<term>-N filename</term>
		<listitem><para>Backup only files newer than filename. Could 
		be used (for example) on a log file to implement incremental
		backups. </para></listitem>
		</varlistentry>


		<varlistentry>
		<term>-i</term>
		<listitem><para>Incremental mode; tar files are only backed 
		up if they have the archive bit set. The archive bit is reset 
		after each file is read. </para></listitem>
		</varlistentry>


		<varlistentry>
		<term>-r</term>
		<listitem><para>Restore. Files are restored to the share 
		from the tar file. </para></listitem>
		</varlistentry>



		<varlistentry>
		<term>-l log level</term>
		<listitem><para>Log (debug) level. Corresponds to the 
		<parameter>-d</parameter> flag of <command>smbclient(1)
		</command>. </para></listitem>
		</varlistentry>
	</variablelist>
</refsect1>


<refsect1>
	<title>ENVIRONMENT VARIABLES</title>

	<para>The <parameter>$TAPE</parameter> variable specifies the 
	default tape device to write to. May be overridden
	with the -t option. </para>
</refsect1>


<refsect1>
	<title>BUGS</title>

	<para>The <command>smbtar</command> script has different 
	options from ordinary tar and from smbclient's tar command. </para>

</refsect1>

<refsect1>
	<title>CAVEATS</title>

	<para>Sites that are more careful about security may not like 
	the way the script handles PC passwords. Backup and restore work 
	on entire shares; should work on file lists. smbtar works best
	with GNU tar and may not work well with other versions. </para>
</refsect1>


<refsect1>
	<title>DIAGNOSTICS</title>

	<para>See the <emphasis>DIAGNOSTICS</emphasis> section for the 
	<ulink url="smbclient.1.html"><command>smbclient(1)</command> 
	</ulink> command.</para>
</refsect1>


<refsect1>
	<title>VERSION</title>

	<para>This man page is correct for version 3.0 of 
	the Samba suite.</para>
</refsect1>

<refsect1>
	<title>SEE ALSO</title>
	<para><ulink url="smbd.8.html"><command>smbd(8)</command></ulink>, 
	<ulink url="smbclient.1.html"><command>smbclient(1)</command></ulink>, 
	<ulink url="smb.conf.5.html">smb.conf(5)</ulink>,
	</para>
</refsect1>

<refsect1>
	<title>AUTHOR</title>
	
	<para>The original Samba software and related utilities 
	were created by Andrew Tridgell. Samba is now developed
	by the Samba Team as an Open Source project similar 
	to the way the Linux kernel is developed.</para>
	
	<para><ulink url="mailto:poultenr@logica.co.uk">Ricky Poulten</ulink>  
	wrote the tar extension and this man page. The <command>smbtar</command> 
	script was heavily rewritten and improved by <ulink 
	url="mailto:Martin.Kraemer@mch.sni.de">Martin Kraemer</ulink>. Many 
	thanks to everyone who suggested extensions, improvements, bug 
	fixes, etc. The man page sources were converted to YODL format (another 
	excellent piece of Open Source software, available at
	<ulink url="ftp://ftp.icce.rug.nl/pub/unix/">
	ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0 
	release by Jeremy Allison.  The conversion to DocBook for 
	Samba 2.2 was done by Gerald Carter.</para>
</refsect1>

</refentry>
