<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>olivetalks &#187; samba</title>
	<atom:link href="http://www.olivetalks.com/tag/samba/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.olivetalks.com</link>
	<description>The Olive has arrived and it has things to say…</description>
	<lastBuildDate>Tue, 16 Nov 2010 19:25:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Automatic backup of Windows computers using Linux</title>
		<link>http://www.olivetalks.com/2008/02/21/automatic-backup-of-windows-computers-using-linux/</link>
		<comments>http://www.olivetalks.com/2008/02/21/automatic-backup-of-windows-computers-using-linux/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 09:05:32 +0000</pubDate>
		<dc:creator>ZoltarStark</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.olivetalks.com/2008/02/21/automatic-backup-of-windows-computers-using-linux/</guid>
		<description><![CDATA[Learn how to setup automatic backups of Windows computers using only free Linux software. The solution stores the backups on a Linux server using rsnapshot, samba and autofs.]]></description>
			<content:encoded><![CDATA[<p>Quite a common setup for people is to use Windows PCs with Linux servers. This configuration allows you to benefit from a stable, standard based and secure server platform which doesn&#8217;t burn a whole in your pocket while letting the users continue operating the tools they know. A usual solution is to run <a href="http://www.samba.org/">samba</a> on a Linux server which can then act as a Windows Domain Controller. This allows Windows clients to log on to the domain and access file and printer shares on the server. Of course you can also have Linux clients integrated in that configuration but this is not going to be the subject of this article.</p>
<p>Usually the Windows PCs store the user profiles on the server. Backing the user profiles can then be done as part of backing up the whole server. You might have some other files though which are not part of the user profile. Backing up these files can be easily done using <a href="http://www.rsnapshot.org/">rsnapshot</a> and <a href="http://wiki.autofs.net/">autofs</a>.</p>
<p>We&#8217;ll use autofs to setup file sharing between the Windows PCs and the Linux server. This is especially useful for computers which are not always connected to the network like laptops, although people do turn off their desktops as well from time to time. What autofs allows us to do is to activate file sharing only when it&#8217;s needed for the purpose of doing a backup.</p>
<p>Performing the actual backup will be done using rsnapshot. This tool, which I already mentioned in a <a href="/2008/02/08/thats-how-ive-learned-to-like-jazz/">previous post</a>, allows space efficient backups which are stored incrementally while offering ease of access usually associated with full backups.</p>
<p>Before setting up autofs we need to <a href="http://www.balliol.ox.ac.uk/comp/shares/index.asp">create a network share</a> on the Windows PC. Remember the user and the password since we&#8217;ll need them later on. In this article I&#8217;m going to assume the user name is <em>backup</em> and the password is <em>secret</em> but you should use something more difficult to guess depending on your security requirements. I&#8217;m also assuming the Windows domain is called <em>company</em>. On the Linux server you then need to make sure you&#8217;ve got <em>autofs</em> installed. Installation of <em>autofs</em> is not covered here but usually it&#8217;s as simple as executing <code>yum install autofs</code>. You need to edit <code>/etc/auto.master</code> file and add this line</p>
<p><code>/smb /etc/auto.windows --timeout=60</code></p>
<p>Then you create the file <code>/etc/auto.windows</code> containing the following, in a single line:</p>
<p><code><em>&lt;share&gt;</em> -fstype=smbfs,<br />
credentials=/etc/auto.windows.<em>&lt;credentials file&gt;</em>,<br />
uid=<em>&lt;user&gt;</em>,gid=<em>&lt;group&gt;</em>,<br />
fmask=0755,dmask=0755  ://<em>&lt;windows PC&gt;</em>/<em>&lt;network share&gt;</em></code></p>
<p>This must be written on a single line, with no separating spaces starting from <code>-fstype</code> to <code>dmask=0755</code></p>
<p><code>&lt;share&gt;</code> is the name of directory where you want to mount the network share from Windows PC.</p>
<p><code>/etc/auto.windows.&lt;credentials file&gt;</code> is the name of file where you store the user name and password needed to access the network share on Windows PC. In our case it will look like this:</p>
<p><code>username = backup<br />
password = secret<br />
domain = company<br />
</code></p>
<p>After these preparations it&#8217;s time to tell the <em>autofs</em> daemon about these changes by executing <code>service autofs reload</code> or a corresponding command. You should be able now to see that the network share gets automatically mounted when you execute <code>ls /smb/&lt;share&gt;</code>. After 60 seconds the share will be unmounted.</p>
<p>Now the last part &#8211; setting up rsnapshot. Just follow the <a href="http://www.rsnapshot.org/howto/1.2/rsnapshot-HOWTO.en.html">instructions</a> for rsnapshot as if the directory <code>/smb/&lt;share&gt;</code> was local. Thanks to <em>autofs</em>, rsnapshot doesn&#8217;t need to know that it&#8217;s really on a different computer running Windows. Remember to set up a cron job if this is your first time you&#8217;re using <em>rsnapshot</em>.</p>
<p>That&#8217;s it. You&#8217;ve configured an automatic backup of a Windows computer using Linux. You can repeat this procedure on further Windows clients.</p>
<p>P.S. Another approach is described <a href="http://www.stillnetstudios.com/2006/12/09/snapshot-backups-howto/">here</a> but it has the drawback that it requires installing additional software on the Windows PCs.</p>
<hr align="left" width="20%" /> <a href="/category/computers/feed" title="rss feed to post"><img src="/wp-content/uploads/2008/01/feed-icon-14x14.png" alt="rss feed to post" /></a> Subscribe to the Computers posts of olivetalks, if you found this article interesting, thank you!</p>
<h3>Related post(s)</h3><ul class="related_post"><li><a href="http://www.olivetalks.com/2009/06/24/skype-40-for-windows-is-out-pros-and-cons-compared-with-linux-skype-20/" title="Skype 4.0 for Windows is out: Pros and cons (compared with Linux Skype 2.0) ">Skype 4.0 for Windows is out: Pros and cons (compared with Linux Skype 2.0)  (1)</a></li><li><a href="http://www.olivetalks.com/2008/06/17/too-much-success-and-popularity/" title="Too much success and popularity?">Too much success and popularity? (0)</a></li><li><a href="http://www.olivetalks.com/2008/02/08/thats-how-ive-learned-to-like-jazz/" title="That&#8217;s how I&#8217;ve learned to like Jazz">That&#8217;s how I&#8217;ve learned to like Jazz (2)</a></li><li><a href="http://www.olivetalks.com/2009/02/21/ups-on-centos-with-selinux-part-2/" title="Setting up UPS on CentOS 5.2 with SELinux, part 2">Setting up UPS on CentOS 5.2 with SELinux, part 2 (1)</a></li><li><a href="http://www.olivetalks.com/2009/02/19/ups-on-centos-with-selinux-part-1/" title="Setting up UPS on CentOS 5.2 with SELinux, part 1">Setting up UPS on CentOS 5.2 with SELinux, part 1 (0)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.olivetalks.com/2008/02/21/automatic-backup-of-windows-computers-using-linux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

