<?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>Admin&#039;s Choice &#187; Backup</title>
	<atom:link href="http://adminschoice.com/category/backup-restore/feed" rel="self" type="application/rss+xml" />
	<link>http://adminschoice.com</link>
	<description>Unix adminstrators documents , tip and more</description>
	<lastBuildDate>Thu, 11 Feb 2010 02:53:34 +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>Backup commands &#8211; usage and examples</title>
		<link>http://adminschoice.com/backup-commands-examples</link>
		<comments>http://adminschoice.com/backup-commands-examples#comments</comments>
		<pubDate>Mon, 21 Dec 2009 06:22:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Backup]]></category>

		<guid isPermaLink="false">http://adminschoice.com/wp28/?p=40</guid>
		<description><![CDATA[Unix backup and restore can be done using unix commands ufsdump , tar , cpio and this document  will give you overview of commands , syntax and examples]]></description>
			<content:encoded><![CDATA[<p><b>Backup commands &#8211; ufsdump, tar , cpio</b><br />
Unix backup and restore can be done using unix commands ufsdump , tar ,<br />
cpio . Though these commands may be sufficient for small setups in<br />
order to take a enterprise backup you have to go in for some custom<br />
backup and restore solutions like Symatic netbackup, EMC networker or<br />
Amanda .<br />
Any backup solution using these commands depends on the type of backup you<br />
are taking and capability of the commands to fulfill the requirement . Following<br />
paragraphs will give you an idea of commands , syntax and examples.</p>
<p><b>Features of  ufsdump , tar , cpio   </b></p>
<blockquote>
<p>
   <b>ufsdump</b><br />
  1. Used for complete file system backup .<br />
  2. It copies every thing from regular files in a file system to  special character and block device files.<br />
  2. It can work on mounted or unmounted file systems.</p>
<p><b>  tar:</b><br />
  1. Used for single or multiple files backup .<br />
  2. Can’t backup special character &amp; block device files ( 0 byte files ).<br />
  3. Works only on mounted file system.</p>
<p>  <b>cpio</b>:<br />
  1. Used for single or multiple files backup .<br />
  2. Can  backup special character &amp; block device files .<br />
  3. Works only on mounted file system.<br />
  4. Need a list of files to be  backed up .<br />
  5. Preserve hard links and time stamps of the files .</p>
</blockquote>
<p>
<b>Identifying  the tape device in Solaris</b></p>
<blockquote>
<p>  dmesg | grep st</p>
</blockquote>
<p><b>Checking  the status of the tape drive</b></p>
<blockquote>
<p>  mt -f /dev/rmt/0  status
</p></blockquote>
<p><b>Backup restore and disk copy with ufsdump :</b> </p>
<blockquote>
<p><b>Backup file system using  ufsdump</b><br />
ufsdump 0cvf /dev/rmt/0 /dev/rdsk/c0t0d0s0<br />
  or<br />
  ufsdump 0cvf   /dev/rmt/0  /usr</p>
<p><b>To restore a dump with ufsrestore<br />
</b><br />
  ufsrestore rvf  /dev/rmt/0<br />
  ufsrestore in interactive mode allowing selection of individual files and&nbsp;<br />
directories using add , ls , cd , pwd and extract commands .<br />
  ufsrestore -i  /dev/rmt/0</p>
</blockquote>
<p><b>Making a copy of  a  disk slice using ufsdump<br />
</b></p>
<blockquote>
<p>
  ufsdump 0f &#8211; /dev/rdsk/c0t0d0s7 |(cd /mnt/backup ;ufsrestore xf -)</p>
</blockquote>
<p><b>Backup restore and disk copy with tar : </b></p>
<blockquote>
<p><b><br />
 &#8211; </b>Backing up all files in a directory including subdirectories  to a&nbsp; tape device (/dev/rmt/0),</p>
<p>  tar cvf  /dev/rmt/0     *</p>
<p><b>Viewing a tar backup on a tape</b></p>
<p>  tar tvf /dev/rmt/0</p>
<p><b>Extracting tar backup from the tape<br />
</b><br />
  tar xvf /dev/rmt/0<br />
  (Restoration will go to present directory or original backup path depending on<br />
  relative or  absolute  path names used for backup )</p>
</blockquote>
<p><b>Backup restore and disk copy with tar :</b></p>
<blockquote>
<p>
<b>Back up all the files in current directory to tape .</b></p>
<p>  find  . -depth  -print | cpio -ovcB &gt; /dev/rmt/0<br />
  cpio expects a list of files and find command provides the list , cpio has<br />
  to put these file on some destination and a &gt; sign redirect these files to tape . This can be a file as well .</p>
<p><b>Viewing cpio files on a tape</b></p>
<p>  cpio -ivtB &lt; /dev/rmt/0</p>
<p><b>Restoring a cpio backup</b></p>
<p>  cpio -ivcB &lt; /dev/rmt/0</p>
</blockquote>
<p><b>Compress/uncompress files :</b></p>
<blockquote>
<p>
You may have to compress the files before or after the backup and it can be done with following commands .<br />
<b>Compressing  a file</b></p>
<p>  compress -v file_name<br />
  gzip   filename</p>
</blockquote>
<p><b>To uncompress a file</b></p>
<blockquote>
<p>  uncompress file_name.Z<br />
  or<br />
  gunzip filename</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://adminschoice.com/backup-commands-examples/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
