<?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>Computer Support &#187; manage</title>
	<atom:link href="http://www.xiitec.com/blog/tag/manage/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xiitec.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 30 Dec 2009 08:40:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Managing the Leases for a Scope</title>
		<link>http://www.xiitec.com/blog/2008/02/21/managing-the-leases-for-a-scope/</link>
		<comments>http://www.xiitec.com/blog/2008/02/21/managing-the-leases-for-a-scope/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 22:38:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DHCP]]></category>
		<category><![CDATA[lease]]></category>
		<category><![CDATA[manage]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=166</guid>
		<description><![CDATA[If you delete a lease, you&#8217;ll also need to make sure the client isn&#8217;t actively using that IP address anymore. Simply deleting the lease on the DHCP Server makes that lease available again for other clients to use. It doesn&#8217;t actually do anything to the client itself. You can release a lease on the client [...]]]></description>
			<content:encoded><![CDATA[<p>If you delete a lease, you&#8217;ll also need to make sure the client isn&#8217;t actively using that IP address anymore. Simply deleting the lease on the DHCP Server makes that lease available again for other clients to use. It doesn&#8217;t actually do anything to the client itself. You can release a lease on the client by running ipconfig /release. Then run ipconfig /renew to request a new lease.</p>
<p><span id="more-166"></span></p>
<p>The netsh command supports a few other options for deleting leases. Instead of specifying the lease IP address, you can instead specify a hostname. The following command deletes the lease associated with the host rallen-wxp in the scope 10.1.2.0:</p>
<pre>&gt; netsh dhcp server scope 10.1.2.0 delete lease \\rallen-wxp</pre>
<p>If there are multiple leases that have been allocated to rallen-wxp, only the first one will be deleted. You can also delete all leases marked as BAD_ADDRESS (which indicates the server attempted to assign the lease IP, but some other device is using that address). The following command deletes all BAD_ADDRESS leases:</p>
<pre>&gt; netsh dhcp server scope 10.1.2.0 delete lease allbadaddresses</pre>
<p>Finally, you can delete all leases obtained by a RAS server using the following command:</p>
<pre>&gt; netsh dhcp server scope 10.1.2.0 delete lease allrasserveraddresses</pre>
<p><strong>Using a graphical user interface</strong></p>
<ol>
<li>Open the DHCP snap-in.</li>
<li>In the left pane, right-click on DHCP and select Add Server.</li>
<li>Type in the name of the DHCP Server you want to target and click OK.</li>
<li>Expand the target scope.</li>
<li>Click on Address Leases. The list of allocated leases will be displayed in the right pane.</li>
<li>To delete a lease, right-click the target lease in the right pane and select Delete.</li>
<li>Confirm the deletion by selecting Yes.</li>
</ol>
<p>If you are interested in scope utilization, you can view the statistics on a per-scope basis by right-clicking the scope and selecting Display Statistics.</p>
<p><strong>Using a command-line interface</strong></p>
<p>The following command displays the allocated leases for scope 10.1.2.0:</p>
<pre>&gt; netsh dhcp server scope 10.1.2.0 show clients</pre>
<p>The following command deletes the lease for IP address 10.1.2.5:</p>
<pre>&gt; netsh dhcp server scope 10.1.2.0 delete lease 10.1.2.5</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/21/managing-the-leases-for-a-scope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing Routes</title>
		<link>http://www.xiitec.com/blog/2008/02/14/managing-routes/</link>
		<comments>http://www.xiitec.com/blog/2008/02/14/managing-routes/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 01:11:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[manage]]></category>
		<category><![CDATA[route]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=132</guid>
		<description><![CDATA[ Using a command-line interface
The following command displays all the static and dynamic routes on a  system:
&#62; route print


This command only shows routes that start with 64:
&#62; route print 64.*
To add a temporary route (one that is erased after the system  reboots), use this command:
&#62; route ADD &#60;Network&#62; MASK &#60;Mask&#62; &#60;Gateway&#62; MEtrIC &#60;Metric&#62; [...]]]></description>
			<content:encoded><![CDATA[<p> <strong>Using a command-line interface</strong></p>
<p>The following command displays all the static and dynamic routes on a  system:</p>
<pre>&gt; route print</pre>
<pre></pre>
<p><span id="more-132"></span></p>
<p>This command only shows routes that start with 64:</p>
<p>&gt; route print 64.*</p>
<p>To add a temporary route (one that is erased after the system  reboots), use this command:</p>
<p>&gt; route ADD <tt><em>&lt;Network&gt;</em></tt> MASK <tt><em>&lt;Mask&gt;</em></tt> <tt><em>&lt;Gateway&gt;</em></tt> MEtrIC <tt><em>&lt;Metric&gt;</em></tt> IF <tt><em>&lt;Interface#&gt;</em></tt></p>
<p>For example:</p>
<p>&gt; route ADD 157.0.0.0 MASK 255.0.0.0  157.55.80.1 METRIC 3 IF 2</p>
<p>To add a permanent route, use the same command as before except  include the <tt>-p</tt> switch. To delete a route, use this command:</p>
<p>&gt; route DELETE <tt><em>&lt;Network&gt;</em></tt></p>
<p>For example:</p>
<p>&gt; route DELETE 157.0.0.0</p>
<p><strong>Using VBScript</strong></p>
<pre>' This code prints similar information to the "route print" command.

' Since the Win32_IP4RouteTable class was first introduced in

' Windows Server 2003, this script does not work against a

' Windows 2000 server.

' ------ SCRIPT CONFIGURATION ------

strComputer = "."

' ------ END CONFIGURATION ---------

set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")

set colRoutes = objWMI.InstancesOf("Win32_IP4RouteTable")

for each objRoute in colRoutes    set colNetworkAdapters = objWMI.ExecQuery(_

                    "select * from Win32_NetworkAdapterConfiguration " &amp; _

                    " where Interfaceindex = " &amp; objRoute.InterfaceIndex )

    for each objNetworkAdapter in colNetworkAdapters

       for each strIP in objNetworkAdapter.IPAddress

          WScript.Echo "Interface: " &amp; strIP

       next

    next

WScript.Echo "Network:   " &amp; objRoute.Destination

    WScript.Echo "NetMask:   " &amp; objRoute.Mask

    WScript.Echo "Gateway:   " &amp; objRoute.NextHop

    WScript.Echo "Metric:    " &amp; objRoute.Metric1

' Other properties you can display:

    ' WScript.Echo "Age: " &amp; objRoute.Age

    ' WScript.Echo "Description: " &amp; objRoute.Description

    ' WScript.Echo "Information: " &amp; objRoute.Information

    ' WScript.Echo "Interface Index: " &amp; objRoute.InterfaceIndex

    ' WScript.Echo "Metric 2: " &amp; objRoute.Metric2

    ' WScript.Echo "Metric 3: " &amp; objRoute.Metric3

    ' WScript.Echo "Metric 4: " &amp; objRoute.Metric4

    ' WScript.Echo "Metric 5: " &amp; objRoute.Metric5

    ' WScript.Echo "Name: " &amp; objRoute.Name

    ' WScript.Echo "Protocol: " &amp; objRoute.Protocol

    ' WScript.Echo "Status: " &amp; objRoute.Status

    ' WScript.Echo "Type: " &amp; objRoute.Type

WScript.Echo

next

' This code shows how to add a route.

' Since the Win32_IP4RouteTable class was first introduced in

' Windows Server 2003, this script does not work against a

' Windows 2000 server.

' ------ SCRIPT CONFIGURATION ------

strComputer = "."

' ------ END CONFIGURATION ---------

set objLocator = CreateObject("WbemScripting.SWbemLocator")

set objWMI = objLocator.ConnectServer(strComputer, "root/CIMv2")

set objR = objWMI.get("Win32_IP4RouteTable").SpawnInstance_( )

objR.Destination = "64.0.0.0"

objR.NextHop = "64.102.57.1"

objR.Mask = "255.0.0.0"

objR.InterfaceIndex = 65539

objR.Metric1 = 22

objR.Protocol = 1

objR.Type = 4

objR.Put_( )</pre>
<pre>Wscript.Echo "Successfully created route"</pre>
<p>If networks are designed properly, system administrators  shouldn&#8217;t have to worry much about how traffic is being routed. Nevertheless, in  certain situations where the network is not fully routed or you are experiencing  routing issues, you may need to dig into a server&#8217;s routing tables. You can also  add static routes to temporarily get traffic flowing the way you want to or  force it to go a certain way. However, I do not recommend configuring permanent  static routes if you can avoid it. This type of manual configuration if often  overlooked or forgotten and can be a headache to track down later unless the  configuration changes are well known by all that are maintaining the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/14/managing-routes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing Backups</title>
		<link>http://www.xiitec.com/blog/2008/02/04/managing-backups/</link>
		<comments>http://www.xiitec.com/blog/2008/02/04/managing-backups/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 19:24:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Shell scripts]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[manage]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=95</guid>
		<description><![CDATA[Managing system backups is a task that all system administrators are familiar with, and it&#8217;s something that no one thanks you for doing unless something goes horribly wrong. Even on a single-user personal computer running Linux, some sort of backup schedule is essential, and it&#8217;s usually only after you&#8217;ve been burned once, losing a chunk [...]]]></description>
			<content:encoded><![CDATA[<p>Managing system backups is a task that all system administrators are familiar with, and it&#8217;s something that no one thanks you for doing unless something goes horribly wrong. Even on a single-user personal computer running Linux, some sort of backup schedule is essential, and it&#8217;s usually only after you&#8217;ve been burned once, losing a chunk of data and files, that you realize the value of a regular backup.</p>
<p><span id="more-95"></span></p>
<p>One of the reasons so many systems neglect backups is that many of the backup tools are crude and difficult to understand. The dump and restore commands (called ufsdump and restore in Solaris) are typical, with five &#8220;dump levels&#8221; and an intimidating configuration file required.</p>
<p>A shell script can solve this problem. This script backs up a specified set of directories, either incrementally (that is, only those files that have changed since the last backup) or full backup (all files). The backup is compressed on the fly to minimize space usage, and the script output can be directed to a file, a tape device, a remotely mounted NFS partition, or even a CD burner on compatible systems.</p>
<blockquote><p>#!/bin/sh</p>
<p># backup &#8211; Creates either a full or incremental backup of a set of<br />
#     defined directories on the system. By default, the output<br />
#     file is saved in /tmp with a timestamped filename, compressed.<br />
#     Otherwise, specify an output device (another disk, or a<br />
#     removable storage device).</p>
<p>usageQuit()<br />
{<br />
cat &lt;&lt; &#8220;EOF&#8221; &gt;&amp;2<br />
Usage: $0 [-o output] [-i|-f] [-n]<br />
-o lets you specify an alternative backup file/device<br />
-i is an incremental or -f is a full backup, and -n prevents<br />
updating the timestamp if an incremental backup is done.<br />
EOF<br />
exit 1<br />
}</p>
<p>compress=&#8221;bzip2&#8243;                # change for your favorite compression app<br />
inclist=&#8221;/tmp/backup.inclist.$(date +%d%m%y)&#8221;<br />
output=&#8221;/tmp/backup.$(date +%d%m%y).bz2&#8243;<br />
tsfile=&#8221;$HOME/.backup.timestamp&#8221;<br />
btype=&#8221;incremental&#8221;           # default to an incremental backup<br />
noinc=0                       # and an update of the timestamp</p>
<p>trap &#8220;/bin/rm -f $inclist&#8221; EXIT</p>
<p>while getopts &#8220;o:ifn&#8221; arg; do<br />
case &#8220;$arg&#8221; in<br />
o ) output=&#8221;$OPTARG&#8221;;        ;;<br />
i ) btype=&#8221;incremental&#8221;;     ;;<br />
f ) btype=&#8221;full&#8221;;            ;;<br />
n ) noinc=1;                 ;;<br />
? ) usageQuit                ;;<br />
esac<br />
done</p>
<p>shift $(($OPTIND &#8211; 1))</p>
<p>echo &#8220;Doing $btype backup, saving output to $output&#8221;</p>
<p>timestamp=&#8221;$(date +&#8217;%m%d%I%M&#8217;)&#8221;</p>
<p>if [ "$btype" = "incremental" ] ; then<br />
if [ ! -f $tsfile ] ; then<br />
echo &#8220;Error: can&#8217;t do an incremental backup: no timestamp file&#8221; &gt;&amp;2<br />
exit 1<br />
fi<br />
find $HOME -depth -type f -newer $tsfile -user ${USER:-LOGNAME} | \<br />
pax -w -x tar | $compress &gt; $output<br />
failure=&#8221;$?&#8221;<br />
else<br />
find $HOME -depth -type f -user ${USER:-LOGNAME} | \<br />
pax -w -x tar | $compress &gt; $output<br />
failure=&#8221;$?&#8221;<br />
fi</p>
<p>if [ "$noinc" = "0" -a "$failure" = "0" ] ; then<br />
touch -t $timestamp $tsfile<br />
fi<br />
exit 0</p></blockquote>
<p>For a full system backup, the pax command does all the work, piping its output to a compression program (bzip2 by default) and then to an output file or device. An incremental backup is a bit more tricky because the standard version of tar doesn&#8217;t include any sort of modification time test, unlike the GNU version of tar. The list of files modified since the previous backup is built with find and saved in the inclist temporary file. That file, emulating the tar output format for increased portability, is then fed to pax directly.</p>
<p>Choosing when to mark the timestamp for a backup is an area in which many backup programs get messed up, typically marking the &#8220;last backup time&#8221; when the program has finished the backup, rather than when it started. Setting the timestamp to the time of backup completion can be a problem if any files are modified during the backup process (which can take quite a while if the backup is being fed to a tape device). Because files modified under this scenario would have a last-modified date older than the timestamp date, they would not be backed up the next night.</p>
<p>However, timestamping before the backup takes place is wrong too, because if the backup fails, there&#8217;s no way to reverse the updated timestamp. Both of these problems are avoided by saving the date and time before the backup starts (in the timestamp variable), but applying the value of $timestamp to $tsfile using the -t flag to touch only after the backup has succeeded.</p>
<p>This script has a number of options, all of which can be ignored to perform the default incremental backup based on the timestamp for the last incremental backup. The flags allow you to specify a different output file or device (-o output), to choose a full backup (-f), to actively choose an incremental backup (-i), or to prevent the timestamp file from being updated in the case of an incremental backup (-n).</p>
<blockquote><p>$ backup<br />
Doing incremental backup, saving output to /tmp/backup.140703.bz2</p></blockquote>
<p>As you would expect, the output of a backup program isn&#8217;t very scintillating. But the resulting compressed file is sufficiently large that it shows plenty of data is within:</p>
<blockquote><p> $ ls -l /tmp/backup*<br />
-rw-r&#8211;r&#8211;  1 taylor  wheel  61739008 Jul 14 07:31 backup.140703.bz2</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/04/managing-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

