<?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>Shekhar Govindarajan's Blog &#187; shared hosted server</title>
	<atom:link href="http://www.shekhargovindarajan.com/tag/shared-hosted-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shekhargovindarajan.com</link>
	<description>My Notepad on the Web</description>
	<lastBuildDate>Wed, 08 Feb 2012 04:58:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com/" />
			<item>
		<title>FTP Backups made easy</title>
		<link>http://www.shekhargovindarajan.com/tips-n-tricks/ftp-backups-made-easy/?&#038;owa_medium=feed&#038;owa_sid=&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ftp-backups-made-easy</link>
		<comments>http://www.shekhargovindarajan.com/tips-n-tricks/ftp-backups-made-easy/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 11:54:23 +0000</pubDate>
		<dc:creator>Shekhar</dc:creator>
				<category><![CDATA[Tips N Tricks]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[incremental]]></category>
		<category><![CDATA[lftp]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[scheduled]]></category>
		<category><![CDATA[Secure Shell]]></category>
		<category><![CDATA[shared hosted server]]></category>
		<category><![CDATA[wget]]></category>
		<category><![CDATA[www.mysite.com]]></category>

		<guid isPermaLink="false">http://www.shekhargovindarajan.com/?p=862</guid>
		<description><![CDATA[I do not recall backing up data over FTP (File Transfer Protocol) in the near past. Thanks to the SSH (Secure SHell) suite of programs like SCP (Secure Copy) and SFTP (Secure FTP), and RSync. But recently I had to setup a scheduled and unattended backup of data lying on a shared hosted server using [...]]]></description>
			<content:encoded><![CDATA[<p>I do not recall backing up data over FTP (File Transfer Protocol) in the near past. Thanks to the SSH (Secure SHell) suite of programs like <a href="http://en.wikipedia.org/wiki/Secure_copy" target="_blank">SCP (Secure Copy)</a> and <a href="http://en.wikipedia.org/wiki/SSH_file_transfer_protocol" target="_blank">SFTP (Secure FTP)</a>, and <a href="http://en.wikipedia.org/wiki/Rsync" target="_blank">RSync</a>. But recently I had to setup a scheduled and unattended backup of data lying on a shared hosted server using FTP &#8211; the only available option at my disposal.<a href="http://en.wikipedia.org/wiki/Wget" target="_blank"></a></p>
<p><a href="http://en.wikipedia.org/wiki/Wget" target="_blank">Wget</a> is a popular and obvious choice to try out for FTP backups. But it didn&#8217;t work for me and threw an error saying cannot find .listing file. While I was about to dwell more into wget, I spotted the forgotten hero &#8211; lftp. <span id="more-862"></span>lftp is described as a &#8220;Sophisticated file transfer program&#8221;. Do not mistake sophistication with complexity. I found it simple to use for my task. I had to backup the data from the hosting server to a Linux based machine (running <a href="http://en.wikipedia.org/wiki/CentOS" target="_blank">CentOS</a>). I found lftp preinstalled on the machine. If not found installed, one can install it on a <a href="http://en.wikipedia.org/wiki/Red_Hat" target="_blank">RedHat</a>/<a href="http://en.wikipedia.org/wiki/Fedora_%28operating_system%29" target="_blank">Fedora</a>/CentOS based Linux by using the following command:</p>
<p><em>yum install lftp</em></p>
<p>To backup using lftp, the syntax is:</p>
<p><em>lftp  -p &lt;FTP-Port&gt; -u &#8216;&lt;FTP-Username&gt;&#8217;,'&lt;FTP-Password&gt;&#8217; -e &#8216;mirror &#8211;verbose &lt;FTP-Directory&gt; &lt;Local-Directory&gt; ;quit&#8217;   &lt;FTP-Host&gt;</em></p>
<p>For example:</p>
<p><em>lftp  -p 21 -u &#8216;shekhar&#8217;,'secret&#8217; -e &#8216;mirror &#8211;verbose /public_html /backup/website ;quit&#8217;   www.mysite.com</em></p>
<p>The above command will backup the subdirectories and files in the directory public_html of the website www.mysite.com to a directory named /backup/website on the local machine (on which the lftp command is executed). lftp will automatically create the local directory if it does not exist.</p>
<p>Note that the &#8220;mirror&#8221; option will backup only the files which have changed. This means for the first time, lftp will download/backup all the files from the site. But subsequently, lftp will backup only the new or edited files and directories. This option saves bandwidth by not re-downloading files, if the backup is up to date.</p>
<p>For scheduled and attended backups you can easily schedule a <a href="http://en.wikipedia.org/wiki/Cron" target="_blank">Cron</a> job with the above command. It&#8217;s simple, it works!</p>
<img src="http://www.shekhargovindarajan.com/?ak_action=api_record_view&id=862&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.shekhargovindarajan.com/tips-n-tricks/ftp-backups-made-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

