<?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>Public Mindscript</title>
	<atom:link href="http://publicmind.in/blog/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://publicmind.in/blog</link>
	<description>Simple and Sophisticated</description>
	<lastBuildDate>Fri, 27 May 2011 08:28:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Dumping a remote SVN repository without admin access</title>
		<link>http://publicmind.in/blog/dumping-a-remote-svn-repository-without-admin-access/</link>
		<comments>http://publicmind.in/blog/dumping-a-remote-svn-repository-without-admin-access/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 20:49:47 +0000</pubDate>
		<dc:creator>Nitin</dc:creator>
				<category><![CDATA[Nitin's Blog]]></category>
		<category><![CDATA[cvsdude]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://publicmind.in/blog/?p=415</guid>
		<description><![CDATA[When you need to dump a SVN repository, all you have to do is svnadmin dump REPOS_PATH But wait, then you need to have admin access to the server on which your SVN repository is hosted. Often, that is not the case and you have to contact the company which hosts your repository to do [...]]]></description>
			<content:encoded><![CDATA[<p>When you need to dump a SVN repository, all you have to do is</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">svnadmin dump REPOS_PATH</div></div>
<p>But wait, then you need to have admin access to the server on which your SVN repository is hosted. Often, that is not the case and you have to contact the company which hosts your repository to do it for you. I have a repository hosted at <a href="http://cvsdude.com">CVSdude</a> and I needed to dump it. As I am on the Developer Edition plan, I do not enjoy the privileges to backup my repositories from my admin panel. I could have mailed the guys at cvsdude, who according to me are quite supportive and quick to respond, but that would have taken longer than what I am going to describe next.</p>
<p>SVN provides a unique utility, <strong>svnsync</strong> which is a Subversion remote repository mirroring tool. Put simply, it allows you to replay the revisions of one repository into another one. Now, we can create an empty repository on our local system, synchronize it with the remote repository and then dump the local repository. Follow the following 4 step process to have a dump of your repository:<br />
<span id="more-415"></span></p>
<ol>
<li><strong>Create a local repository</strong>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">svnadmin create c:/repos</div></div>
<p>It will create an empty repository on your local system.</li>
<li><strong>Add “pre-revprop-change” hook to your local repository</strong><br />
You need to add an empty file into the hooks folder of your repository. This file should be named <strong>pre-revprop-change.cmd</strong> on Windows and <strong>pre-revprop-change</strong> on Linux systems.<br />
For Linux users:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">echo ‘#!/bin/sh’ &gt; repos/hooks/pre-revprop-change<br />
chmod +x repos/hooks/pre-revprop-change</div></div>
<p>This allows <strong><em>svnsync</em></strong> to make revision changes to your local repository. Note that your remote repository is never modified during this process, in fact we just need read access to the remote repository.</li>
<li><strong>Synchronize your local repository with the remote repository</strong>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">svnsync init file:///c:/repos https://test.cvsdude.com/fbl<br />
svnsync sync file:///c:/repos</div></div>
</li>
<li><strong>Dump your local repository</strong>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">svnadmin dump file:///c:/repos &amp;gt; repos.dmp</div></div>
</li>
</ol>
<p>That would be all, you can now have a cup of coffee. <img src='http://publicmind.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://publicmind.in/blog/dumping-a-remote-svn-repository-without-admin-access/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP: Archive files for Backup on Server</title>
		<link>http://publicmind.in/blog/php-archive-files-backup/</link>
		<comments>http://publicmind.in/blog/php-archive-files-backup/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 05:25:50 +0000</pubDate>
		<dc:creator>Nitin</dc:creator>
				<category><![CDATA[Nitin's Blog]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.publicmind.in/?p=59</guid>
		<description><![CDATA[As Currently I am hosting this website on a free host, my web host imposes several limitations on me. One of them is not providing the feature to download the whole folder. This makes taking backup really hard as you have download each and every file yourself. Although it is a matter of days when [...]]]></description>
			<content:encoded><![CDATA[<p>As Currently I am hosting this website on a free host, my web host imposes several limitations on me. One of them is not providing the feature to download the whole folder. This makes taking backup really hard as you have download each and every file yourself.  Although it is a matter of days when I shift this website to a new server, I wrote the following PHP script which automatically archives the files in a folder and then the zip files can be easily downloaded with a single click. The script is crude in nature as I did not handle much exceptions but it works fine for me. You might need to change certain parameters to run it with your PHP resource limits. The code is pretty self explanatory although if you find difficulty understanding some part or find a bug or want to suggest any improvement, do leave a comment.<br />
<span id="more-59"></span></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:400px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span> ?<br />
<span style="color: #009933; font-style: italic;">/**<br />
* Copyright (c) 2009, Nitin Kumar Gupta, http://publicmind.in.<br />
* All rights reserved.<br />
*<br />
* Redistribution and use in source and binary forms, with or without<br />
* modification, are permitted provided that the following conditions<br />
* are met:<br />
*<br />
* &nbsp; * Redistributions of source code must retain the above copyright<br />
* &nbsp; &nbsp; notice, this list of conditions and the following disclaimer.<br />
*<br />
* &nbsp; * Redistributions in binary form must reproduce the above<br />
* &nbsp; &nbsp; copyright notice, this list of conditions and the following<br />
* &nbsp; &nbsp; disclaimer in the documentation and/or other materials provided<br />
* &nbsp; &nbsp; with the distribution.<br />
*<br />
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS<br />
* &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT<br />
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS<br />
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE<br />
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,<br />
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,<br />
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;<br />
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER<br />
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT<br />
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY<br />
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY<br />
* OF SUCH DAMAGE.<br />
*/</span><br />
<br />
<span style="color: #666666; font-style: italic;">/*<br />
* This is a BSD License approved by the Open Source Initiative (OSI).<br />
* See: &nbsp;http://www.opensource.org/licenses/bsd-license.php<br />
*/</span><br />
<br />
<span style="color: #009933; font-style: italic;">/**<br />
* Directory to archive.<br />
* example: '.' - root directory<br />
* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'folder/sub-folder/sub-folder' - for an internal folder.<br />
*<br />
* Note: Do not use trailing slashes.<br />
*/</span><br />
<span style="color: #000088;">$directory</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'.'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// File name for the backup along with timestamp. If the filename exists,</span><br />
<span style="color: #666666; font-style: italic;">// They are numbered as backup_1, backup_2,...</span><br />
<span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;d_m_y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;;</span><br />
<span style="color: #000088;">$zipname</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'backup_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$maxFiles</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">500</span><span style="color: #339933;">;</span> &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//Number of files to be added to each archive.</span><br />
<span style="color: #666666; font-style: italic;">//Varies with your PHP Memory limit and execution time.</span><br />
<span style="color: #666666; font-style: italic;">//After a certain limit, the zipArchive is unable to archive.</span><br />
<br />
<span style="color: #000088;">$fileNums</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$filenames</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
parse<span style="color: #009900;">&#40;</span><span style="color: #000088;">$directory</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
zipFiles<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Done&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009933; font-style: italic;">/**<br />
* &nbsp;Archives the files present in the global $filename array.<br />
*<br />
* &nbsp;@return:<br />
*<br />
* &nbsp;0: fail<br />
* &nbsp;1: Success<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">function</span> zipFiles<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$count</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$zipname</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$filenames</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$zipfile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$zipname</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.zip'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zipfile</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$zipfile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$zipname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$count</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.zip'</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$count</span><span style="color: #339933;">++;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000088;">$zip</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ZipArchive<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">open</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zipfile</span><span style="color: #339933;">,</span> ZIPARCHIVE<span style="color: #339933;">::</span><span style="color: #004000;">CREATE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!==</span><span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error opening , Make sure you have write permissionsn&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$filenames</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addFile</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filename</span><span style="color: #339933;">,</span><span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Adding &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$filename</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; to &lt;strong&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$zipfile</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/strong&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Files Packed = &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">numFiles</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">status</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Success&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Fail&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009933; font-style: italic;">/**<br />
* parses the whole directory and archives it in small parts, each<br />
* containg $maxFiles files each.<br />
*<br />
* @param:<br />
*<br />
* $dir: Directory to archive recursively.<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">function</span> parse<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$filenames</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$fileNums</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$maxFiles</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/opendir"><span style="color: #990000;">opendir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">!==</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/readdir"><span style="color: #990000;">readdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;.&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$file</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;..&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <a href="http://www.php.net/is_file"><span style="color: #990000;">is_file</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$filenames</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$file</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$fileNums</span><span style="color: #339933;">++;</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileNums</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$maxFiles</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$fileNums</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>zipFiles<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$filenames</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;.&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$file</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;..&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <a href="http://www.php.net/is_dir"><span style="color: #990000;">is_dir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
parse<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<a href="http://www.php.net/closedir"><span style="color: #990000;">closedir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>To get going, just upload the script file in your root directory and point the $directory variable to the folder you want to archive. Now run the script using your web browser(make sure you run it once) and you are done. You will see the backup zip files in the current directory.</p>
<p>Hope you find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://publicmind.in/blog/php-archive-files-backup/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

