1<HTML> 2<HEAD> 3<TITLE> 4[Chapter 8] 8.7 Backups with smbtar</title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly & Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:36:02Z"><META NAME="DC.type" CONTENT="Text.Monograph"><META NAME="DC.format" CONTENT="text/html" SCHEME="MIME"><META NAME="DC.source" CONTENT="" SCHEME="ISBN"><META NAME="DC.language" CONTENT="en-US"><META NAME="generator" CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"></head> 5<BODY BGCOLOR="#FFFFFF" TEXT="#000000" link="#990000" vlink="#0000CC"> 6<table BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%"> 7<tr> 8<td width="25%" valign="TOP"> 9<img hspace=10 vspace=10 src="gifs/samba.s.gif" 10alt="Using Samba" align=left valign=top border=0> 11</td> 12<td height="105" valign="TOP"> 13<br> 14<H2>Using Samba</H2> 15<font size="-1"> 16Robert Eckstein, David Collier-Brown, Peter Kelly 17<br>1st Edition November 1999 18<br>1-56592-449-5, Order Number: 4495 19<br>416 pages, $34.95 20</font> 21<p> <a href="http://www.oreilly.com/catalog/samba/">Buy the hardcopy</a> 22<p><a href="index.html">Table of Contents</a> 23</td> 24</tr> 25</table> 26<hr size=1 noshade> 27<!--sample chapter begins --> 28 29<center> 30<DIV CLASS="htmlnav"> 31<TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 32<TR> 33<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 34<A CLASS="sect1" HREF="ch08_06.html" TITLE="8.6 Miscellaneous Options"> 35<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 8.6 Miscellaneous Options" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 36<B> 37<FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1"> 38<A CLASS="chapter" REL="up" HREF="ch08_01.html" TITLE="8. Additional Samba Information "> 39Chapter 8<br> 40Additional Samba Information </a></font></b></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 41<A CLASS="chapter" HREF="ch09_01.html" TITLE="9. Troubleshooting Samba"> 42<IMG SRC="gifs/txtnexta.gif" ALT="Next: 9. Troubleshooting Samba" BORDER="0"></a></td></tr></table> <hr noshade size=1></center> 43</div> 44<blockquote> 45<div> 46<H2 CLASS="sect1"> 47<A CLASS="title" NAME="ch08-74829"> 488.7 Backups with smbtar</a></h2><P CLASS="para">Our final topic in this chapter is the <I CLASS="filename"> 49smbtar</i> tool. One common problem with modem PCs is that floppies and even CD-ROMs are often too small to use for backups. However, buying one tape drive per machine would also be silly. Consequently, many sites don't back up their PCs at all. Instead, they reinstall them using floppy disks and CD-ROMs when they fail.</p><P CLASS="para"> 50Thankfully, Samba provides us with another option: you can back up PCs' data using the <I CLASS="filename"> 51smbtar</i> tool. This can be done on a regular basis if you keep user data on your Samba system, or only occasionally, to save the local applications and configuration files and thus make repairs and reinstallations quicker.</p><P CLASS="para"> 52To back up PCs from a Unix server, you need to do three things:</p><OL CLASS="orderedlist"> 53<LI CLASS="listitem"> 54<P CLASS="para"> 55<A CLASS="listitem" NAME="ch08-pgfId-961555"> 56</a>Ensure that File and Printer Sharing is installed on the PC and is bound to the TCP/IP protocol.</p></li><LI CLASS="listitem"> 57<P CLASS="para"> 58<A CLASS="listitem" NAME="ch08-pgfId-961564"> 59</a>Explicitly share a disk on the PC so it can be read from the server.</p></li><LI CLASS="listitem"> 60<P CLASS="para"> 61<A CLASS="listitem" NAME="ch08-pgfId-961567"> 62</a>Set up the backup scripts on the server.</p></li></ol><P CLASS="para"> 63We'll use Windows 95/98 to illustrate the first two steps. Go to the Networking icon in the Control Panel window, and check that File and Printer Sharing for Microsoft Networks is currently listed in the top window, as shown in <A CLASS="xref" HREF="ch08_07.html#ch08-18303"> 64Figure 8.2</a>. </p><H4 CLASS="figure"> 65<A CLASS="title" NAME="ch08-18303"> 66Figure 8.2: The Networking window</a></h4><IMG CLASS="graphic" SRC="figs/sam.0802.gif" ALT="Figure 8.2"><P CLASS="para"> 67If "File and printer sharing for Microsoft Networks" isn't installed, you can install it by clicking on the Add button on the Network panel. After pressing it, you will be asked what service to add. Select Service and move forward, and you will be asked for a vendor and a service to install. Finally, select "File and printer sharing for Microsoft Networks," and click on Done to install the service.</p><P CLASS="para"> 68Once you've installed "File and printer sharing for Microsoft Networks," return to the Network panel and select the TCP/IP protocol that is tied to your Samba network adapter. Then, click on the Properties button and choose the Bindings tab at the top. You should see a dialog box similar to <A CLASS="xref" HREF="ch08_07.html#ch08-41042"> 69Figure 8.3</a>. Here, you'll need to verify that the "File and Printer Sharing" checkbox is checked, giving it access to TCP/IP. At this point you can share disks with other machines on the net. </p><H4 CLASS="figure"> 70<A CLASS="title" NAME="ch08-41042"> 71Figure 8.3: TCP/IP Bindings</a></h4><IMG CLASS="graphic" SRC="figs/sam.0803.gif" ALT="Figure 8.3"><P CLASS="para"> 72The next step is to share the disk you want to back up with the tape server. Go to My Computer and select, for example, the My Documents directory. Then right-click on the icon and select its Properties. This should yield the dialog box in <A CLASS="xref" HREF="ch08_07.html#ch08-64918"> 73Figure 8.4</a>. </p><H4 CLASS="figure"> 74<A CLASS="title" NAME="ch08-64918"> 75Figure 8.4: My Documents Properties</a></h4><IMG CLASS="graphic" SRC="figs/sam.0804.gif" ALT="Figure 8.4"><P CLASS="para"> 76Select the Sharing tab and turn file sharing on. You now have the choice to share the disk as read-only, read-write (Full), or either, each with separate password. This is the Windows 95/98 version, so it provides only share-level security. In this example, we made it read/write and set a password, as shown in <A CLASS="xref" HREF="ch08_07.html#ch08-29192"> 77Figure 8.5</a>. When you enter the password and click on OK, you'll be prompted to re-enter it. After that, you have finished the second step. </p><H4 CLASS="figure"> 78<A CLASS="title" NAME="ch08-29192"> 79Figure 8.5: MyFiles Properties as shared</a></h4><IMG CLASS="graphic" SRC="figs/sam.0805.gif" ALT="Figure 8.5"><P CLASS="para"> 80Finally, the last step is to set up a backup script on the tape server, using the <I CLASS="filename"> 81smbtar</i> program. The simplest script might contain only a single line and would be something like the following:</p><PRE CLASS="programlisting"> 82smbtar -s client -t /dev/rst0 -x "My Documents" -p <CODE CLASS="replaceable"><I>password</i></code></pre><P CLASS="para"> 83This unconditionally backs up the <EM CLASS="emphasis"> 84//client/My Documents</em> share to the device <I CLASS="filename"> 85/dev/rst0</i>. Of course, this is excessively simple and quite insecure. What you will want to do will depend on your existing backup scheme. </p><P CLASS="para"> 86However, to whet your appetite, here are some possibilities of what <I CLASS="filename"> 87smbtar</i> can do:</p><UL CLASS="itemizedlist"> 88<LI CLASS="listitem"> 89<P CLASS="para"> 90<A CLASS="listitem" NAME="ch08-pgfId-961280"> 91</a>Back up files incrementally using the DOS archive bit (the <CODE CLASS="literal"> 92-i</code> option). This requires the client share to be accessed read-write so the bit can be cleared by <I CLASS="filename"> 93smbtar</i></p></li><LI CLASS="listitem"> 94<P CLASS="para"> 95<A CLASS="listitem" NAME="ch08-pgfId-961281"> 96</a>Back up only files that have changed since a specified date (using the <CODE CLASS="literal"> 97-N</code> <CODE CLASS="replaceable"> 98<I> 99filename </i></code>option)</p></li><LI CLASS="listitem"> 100<P CLASS="para"> 101<A CLASS="listitem" NAME="ch08-pgfId-961282"> 102</a>Back up entire PC drives, by sharing all of C: or D:, for example, and backing that up</p></li></ul><P CLASS="para"> 103Except for the first example, each of these can be done with the PC sharing set to read-only, reducing the security risk of having passwords in scripts and passing them on the command line. </p></div></blockquote> 104<div> 105<center> 106<hr noshade size=1><TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 107<TR> 108<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 109<A CLASS="sect1" HREF="ch08_06.html" TITLE="8.6 Miscellaneous Options"> 110<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 8.6 Miscellaneous Options" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 111<A CLASS="book" HREF="index.html" TITLE=""> 112<IMG SRC="gifs/txthome.gif" ALT="" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 113<A CLASS="chapter" HREF="ch09_01.html" TITLE="9. Troubleshooting Samba"> 114<IMG SRC="gifs/txtnexta.gif" ALT="Next: 9. Troubleshooting Samba" BORDER="0"></a></td></tr><TR> 115<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 1168.6 Miscellaneous Options</td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 117<A CLASS="index" HREF="inx.html" TITLE="Book Index"> 118<IMG SRC="gifs/index.gif" ALT="Book Index" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 1199. Troubleshooting Samba</td></tr></table><hr noshade size=1></center> 120</div> 121 122<!-- End of sample chapter --> 123<CENTER> 124<FONT SIZE="1" FACE="Verdana, Arial, Helvetica"> 125<A HREF="http://www.oreilly.com/"> 126<B>O'Reilly Home</B></A> <B> | </B> 127<A HREF="http://www.oreilly.com/sales/bookstores"> 128<B>O'Reilly Bookstores</B></A> <B> | </B> 129<A HREF="http://www.oreilly.com/order_new/"> 130<B>How to Order</B></A> <B> | </B> 131<A HREF="http://www.oreilly.com/oreilly/contact.html"> 132<B>O'Reilly Contacts<BR></B></A> 133<A HREF="http://www.oreilly.com/international/"> 134<B>International</B></A> <B> | </B> 135<A HREF="http://www.oreilly.com/oreilly/about.html"> 136<B>About O'Reilly</B></A> <B> | </B> 137<A HREF="http://www.oreilly.com/affiliates.html"> 138<B>Affiliated Companies</B></A><p> 139<EM>© 1999, O'Reilly & Associates, Inc.</EM> 140</FONT> 141</CENTER> 142</BODY> 143</html> 144