 




<?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>Irregular Expressions &#187; snap shot</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/Irregular-Expressions/tag/snap-shot/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/Irregular-Expressions</link>
	<description>Insight into current security related events and exploits, including virtualization security and tips.</description>
	<lastBuildDate>Sun, 28 Apr 2013 08:00:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Finding VM snapshots &#8211; Part 3</title>
		<link>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-3/</link>
		<comments>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-3/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 03:07:43 +0000</pubDate>
		<dc:creator>Dan O'Connor</dc:creator>
				<category><![CDATA[find]]></category>
		<category><![CDATA[snap shot]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[uniq]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[wc]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-3/</guid>
		<description><![CDATA[Find can be given multiple date constraints to narrow down the results returned. `find /vmfs/volumes/ -mtime +1 -mtime -10 -type -f -name &#8220;*00*.vmdk&#8221;` Will locate files that where the file was last modified at least 1 day ago (-mtime +1) but not more then 10 (-mtime -10). Find has several parameters to work with dates. [...]]]></description>
				<content:encoded><![CDATA[<p>Find can be given multiple date constraints to narrow down the results returned.</p>
<p>`find /vmfs/volumes/ -mtime +1 -mtime -10 -type -f -name &#8220;*00*.vmdk&#8221;`</p>
<p>Will locate files that where the file was last modified at least 1 day ago (-mtime +1) but not more then 10 (-mtime -10).</p>
<p>Find has several parameters to work with dates.</p>
<p>ctime &#8211; Locate items by the last status change time.</p>
<p>atime &#8211; Locate items by the last access time.</p>
<p>mtime &#8211; Locate items by the last modified time.</p>
<p>You can also get more granular on the time tests.  With -amin, -cmin, and -mmin.</p>
<p>The -name is not specifically needed, you could also use a regular expression to locate the files that are needed.</p>
<p>find /vmfs/volumes/ -regex &#8216;.*[0-9]+\.vmdk$&#8217; -type f</p>
<p>While the regular expression is useful it will preform the regex on the path returned as well so the results will differ from searching `/vmfs/volumes/` and `.`.</p>
<p>The full find man page is online here http://linux.die.net/man/1/find or you can type `man find` on the esx console.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding VM snapshots &#8211; Part 2</title>
		<link>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-2/</link>
		<comments>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-2/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 02:20:19 +0000</pubDate>
		<dc:creator>Dan O'Connor</dc:creator>
				<category><![CDATA[find]]></category>
		<category><![CDATA[snap shot]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[uniq]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[wc]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/Irregular-Expressions/?p=14</guid>
		<description><![CDATA[Using find to locate vm&#8217;s with snapshots is easy. `find /vmfs/volumes/ -type f -name "*00*.vmdk" &#124; awk -F "/" '{print $1"/"$2"/"$3"/"$4"/"$5 }' &#124; uniq` Find is just not limited to locating the files but it is able to preform actions on it. Using the `-exec` allows any command to be executed. `find /vmfs/volumes/ -type f [...]]]></description>
				<content:encoded><![CDATA[<p>Using find to locate vm&#8217;s with snapshots is easy.</p>
<p><code>`find /vmfs/volumes/ -type f -name "*00*.vmdk" | awk -F "/" '{print $1"/"$2"/"$3"/"$4"/"$5 }' | uniq`</code></p>
<p>Find is just not limited to locating the files but it is able to preform actions on it. Using the `-exec` allows any command to be executed.</p>
<p>`find /vmfs/volumes/ -type f -name &#8220;*00*.vmdk&#8221; -exec ls -alh {} \;`</p>
<p>Will execute `ls -alh` on each file that matches the parameters of the find command.  Adding this will provide date stamps on the files if needed.</p>
<p>Find can also work with dates itself, `-mtime` can be used to give find parameters on the last modified time of a file.  This can be specified in blocks of 24 hours, `-mtime +1` will give files last changed two days ago, not 1, this is because fractions of days are ignored.  Find can also be given multiple date parameters to narrow down the returned results as desired.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding VM snapshots &#8211; Part 1</title>
		<link>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-1/</link>
		<comments>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-1/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 16:20:37 +0000</pubDate>
		<dc:creator>Dan O'Connor</dc:creator>
				<category><![CDATA[find]]></category>
		<category><![CDATA[snap shot]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[uniq]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[wc]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-1/</guid>
		<description><![CDATA[Locating VM&#8217;s with snapshots on a datastore is easy if you know how to use the find command. `find /vmfs/volumes/ -type f -name &#8220;*00*.vmdk&#8221;` Will look through the /vmfs/volumes/ looking for files with names that match the provided pattern. More specifically the folders those files are stored in is needed. AWK can be used to just [...]]]></description>
				<content:encoded><![CDATA[<p>Locating VM&#8217;s with snapshots on a datastore is easy if you know how to use the find command.</p>
<p>`find /vmfs/volumes/ -type f -name &#8220;*00*.vmdk&#8221;` Will look through the /vmfs/volumes/ looking for files with names that match the provided pattern.</p>
<p>More specifically the folders those files are stored in is needed.</p>
<p>AWK can be used to just pull that information back, `find /vmfs/volumes/ -type f -name &#8220;*00*.vmdk&#8221; | awk -F &#8220;/&#8221; &#8216;{print $1&#8243;/&#8221;$2&#8243;/&#8221;$3&#8243;/&#8221;$4&#8243;/&#8221;$5 }&#8217;`.  This output is getting useful but we really don&#8217;t need to see the same folder over and over again.</p>
<p>`find /vmfs/volumes/ -type f -name &#8220;*000*vmdk*&#8221; | awk -F &#8220;/&#8221; &#8216;{print $1&#8243;/&#8221;$2&#8243;/&#8221;$3&#8243;/&#8221;$4&#8243;/&#8221;$5 }&#8217; | uniq` will only return the unique results.  Appending a -c to the `uniq` will provide a count of the number of times that pattern appeared.</p>
<p>I am using this command in two ways, first is the `uniq` with out -c  piped to `wc -l` to get a count of all of the vm&#8217;s with snapshots.   The second is with`uniq -c` piped to `sort -rn` to give the number of disks that have snap shots in each VM.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/Irregular-Expressions/finding-vm-snapshots-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
