<?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>www.unnionline.com &#187; Crontab</title>
	<atom:link href="http://www.unnionline.com/blog/tag/crontab/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unnionline.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 30 Nov 2011 11:49:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Backup Subversion Repositories And Projects</title>
		<link>http://www.unnionline.com/blog/2009/05/backup-subversion-repositories-and-projects/</link>
		<comments>http://www.unnionline.com/blog/2009/05/backup-subversion-repositories-and-projects/#comments</comments>
		<pubDate>Tue, 12 May 2009 15:51:08 +0000</pubDate>
		<dc:creator>cbaunni</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[cron jobm rsync]]></category>
		<category><![CDATA[Crontab]]></category>
		<category><![CDATA[hot-backup.py]]></category>
		<category><![CDATA[Repositories]]></category>
		<category><![CDATA[subversion backup]]></category>
		<category><![CDATA[subversion server]]></category>
		<category><![CDATA[svn backup]]></category>
		<category><![CDATA[svn hotcopy]]></category>
		<category><![CDATA[svnadmin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.unnionline.com/blog/?p=97</guid>
		<description><![CDATA[After I decided to manage]]></description>
			<content:encoded><![CDATA[<p>After I decided to manage my PhD thesis and projects with subversion, the most important thing to consider was a proper backup strategy. I decided to go a bit overboard with it as it might save me some day. There are several ways to backup subversion and I decided to use all of them!</p>
<p><strong>a. Using crontab and rsync to backup subversion</strong></p>
<p>Read my earlier post on crontab if you are not familiar with it. Someday I will write about rsync as well. But for now read  <a href="http://www.samba.org/rsync/">this</a> if you are new to rsync. I use the following code to backup the entire subversion repository to my backup directory.</p>
<p><code>rsync -av --delete --progress /source_directory/subversion/ /destination_directory/backups/subversion_backup/</code></p>
<p>I used crontab to schedule the above job to run at midnight every day. In case something happens to the original subeversion repository, it is easy to retrieve data from this backup &#8211; just copy it to the original location!</p>
<p><strong>b. Using the backup script from COLLABNET (the subversion guys)</strong></p>
<p>The next technique it to use the python based backup script from subversion called hot-backup.py. This script can be used to make a backup of the latest version of the subversion repository. I used the following code to download the latest version from COLLABNET website and install it on my system.</p>
<p><code>wget http://svn.collab.net/repos/svn/trunk/tools/backup/hot-backup.py.in<br />
mv hot-backup.py.in hot-backup.py</code></p>
<p>Once that is done, I had to make some configuration changes in the file. The following lines were changed</p>
<p><code># Path to svnlook utility<br />
svnlook = r"@SVN_BINDIR@/svnlook"<br />
# Path to svnadmin utility<br />
svnadmin = r"@SVN_BINDIR@/svnadmin"</code></p>
<p>to look like this</p>
<p><code># Path to svnlook utility<br />
svnlook = r"/usr/bin/svnlook"<br />
# Path to svnadmin utility<br />
svnadmin = r"/usr/bin/svnadmin"</code></p>
<p>The next step is to run the script check if everything is fine. I used the code below:</p>
<p><code>python hot-backup.py --archive-type=zip --num-backups=10 ~/source_directory/subversion_repository /destination_directory/subversion_backup/</code></p>
<p>The above code will make a hotcopy of the latest version of the subversion repository into the backup directory in zip format. A total of 10 backups will be maintained at a time, oldest one being deleted when new ones are added.</p>
<p>Once the backup was properly inspected I created a cron job to run this command at midnight every day.</p>
<p><strong>c. Using the subversion &#8216;hotcopy&#8217; command</strong></p>
<p>This is a very simple technique as it uses the inbuilt &#8216;hotcopy&#8217; command to backup the svn repository. Follow the command below to make a reliable incremental backup of your svn repositories. </p>
<p><code>svnadmin hotcopy /source_directory/subversion_repository /destination_directory/subversion_backup/</code></p>
<p>Create a cron job to schedule it.</p>
<p>Once you have your backup system in place, rest assured that your data are safe.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unnionline.com/blog/2009/05/backup-subversion-repositories-and-projects/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scheduling Commands With Crontab In Ubuntu</title>
		<link>http://www.unnionline.com/blog/2009/05/scheduling-commands-with-crontab-in-ubuntu/</link>
		<comments>http://www.unnionline.com/blog/2009/05/scheduling-commands-with-crontab-in-ubuntu/#comments</comments>
		<pubDate>Fri, 08 May 2009 14:02:46 +0000</pubDate>
		<dc:creator>cbaunni</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Cronjob]]></category>
		<category><![CDATA[Crontab]]></category>

		<guid isPermaLink="false">http://www.unnionline.com/blog/?p=86</guid>
		<description><![CDATA[The following applies to any]]></description>
			<content:encoded><![CDATA[<p><strong>The following applies to any linux distribution</strong></p>
<p><strong>Crontab</strong></p>
<p>Crontab is an integral part of most Linux distributions.It is a simple text file that holds a list of commands that are scheduled to be run at specified times. These commands, and their relative run times, are controlled by the &#8216;cron&#8217; daemon and are executed in the system background.</p>
<p>Each user on a Linux system has their own crontab which contains the schedule of commands. In order to edit or create a crontab, one must use the text editor that is specified by the system, &#8216;nano&#8217; being the default on my system. To create a crontab open a terminal and type:</p>
<p><code>crontab -e</code></p>
<p>&#8216;nano&#8217; will open with a blank window for the job schedule to be entered. Each line represents a seperate cron job entry &#8211; also known as a &#8216;cron job&#8217;.</p>
<p><strong>Creating a &#8216;cronjob&#8217;</strong></p>
<p>Each section in a cronjob is separated by a space, with the final section having one or more spaces in it. No spaces are allowed within sections 1-5, only between them. Sections 1-5 are used to indicate when and how often the task has to be executed. This is how a cron job is layed out:</p>
<p><code>minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command</code></p>
<p><strong>Example 1</strong></p>
<p><code>01 04 1 1 1 /usr/bin/somedirectory/somecommand</code></p>
<p>The above example will run /usr/bin/somedirectory/somecommand at 4:01am on any Monday which falls on January 1st. An asterisk (*) can be used so that every instance (every hour, every weekday, every month, etc.) of a time period is used. Code:</p>
<p><strong>Example 2</strong></p>
<p><code>01 04 * * * /usr/bin/somedirectory/somecommand</code></p>
<p>The above example will run /usr/bin/somedirectory/somecommand at 4:01am on every day of every month.</p>
<p>The &#8220;/usr/bin/somedirectory/somecommand&#8221; text in the above examples indicate the task that will be run at the specified time. It is recommended to use the full path to the desired command as shown in the above examples. Crontab will echo any mistakes found in a cronjob. The crontab will start running as soon as it is properly edited and saved.</p>
<p><strong>Other crontab options</strong></p>
<p><code>crontab -l option causes the current crontab to be displayed on standard output.<br />
crontab -r option causes the current crontab to be removed.<br />
crontab -e option is used to edit the current crontab using the editor specified by the EDITOR environment variables</code><code> ($EDITOR=vi crontab -e)</code><code>.</code></p>
<p>Note: The double-ampersand (&amp;&amp;) can also be used in the &#8220;command&#8221; section to run multiple commands consecutively.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unnionline.com/blog/2009/05/scheduling-commands-with-crontab-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

