<?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>OpenBSD and FreeBSD resources &#187; cron</title>
	<atom:link href="http://purebsd.com/tag/cron/feed" rel="self" type="application/rss+xml" />
	<link>http://purebsd.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 Jun 2010 06:01:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Cron / crontab</title>
		<link>http://purebsd.com/cron-crontab.html</link>
		<comments>http://purebsd.com/cron-crontab.html#comments</comments>
		<pubDate>Mon, 31 May 2010 23:10:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[cron]]></category>

		<guid isPermaLink="false">http://purebsd.com/?p=12</guid>
		<description><![CDATA[System crontab The system&#8217;s crontab is, unlike on many other Unix flavors, not located in /etc/crontab, but in /var/cron/tabs/root. In other words, the system&#8217;s crontab is seen on OpenBSD as a user&#8217;s crontab. Specifically: as the crontab of the user root. If you&#8217;d like to view the crontab of root, run as user root: crontab -l If [...]]]></description>
			<content:encoded><![CDATA[<p><strong>System crontab</strong></p>
<p>The system&#8217;s crontab is, unlike on many other Unix flavors, not located in <code>/etc/crontab</code>, but in <code>/var/cron/tabs/root</code>. In other words, the system&#8217;s crontab is seen on OpenBSD as a user&#8217;s crontab. Specifically: as the crontab of the user root.</p>
<ul>
<li>If you&#8217;d like to view the crontab of root, run as user root:
<p><code>crontab -l</code></li>
<li>If you&#8217;d like to edit the crontab of root, for intance to change the time the /etc/daily, /etc/weekly and /etc/monthly scripts are run, do as user root:
<p><code>crontab -e</code></p>
<p>Edit the then presented file to your own liking. When you&#8217;re done save and quit vi. The new crontab will automaticly be activated.</li>
<li>If you&#8217;d like to <strong>remove</strong> the crontab of root, run as user root:
<p><code>crontab -r</code></p>
<p>But you probably <strong>never want to do this</strong>!</li>
</ul>
<p>If you&#8217;d like cron to backup your root filesystem (<code>/</code>) each day, do the following:</p>
<ul>
<li>Edit the system&#8217;s crontab:<br />
<code>crontab -e</code></li>
<li>Insert the following line near the other variables:<br />
<code>ROOTBACKUP=1</code></li>
<li>Edit <code>/etc/fstab</code> to have a line like this:<br />
<code>/dev/wd1a /altroot ffs xx 0 0</code><br />
You must only change &#8220;/dev/wd1a&#8221; to reflect the filesystem where the backup should be copied to. Make sure it has enough room to hold the complete <code>/</code> filesystem.</li>
</ul>
<p><strong>Permissions</strong></p>
<p>The crontab files of users are located in <code>/var/cron/tabs</code>. Whether normal users are allowed to use crontab is determined by two files:</p>
<ul>
<li><code>/var/cron/cron.allow</code>:<br />
If this file exists, users listed here (one username per line) are allowed to use cron. All other users are disallowed to use cron.</li>
<li><code>/var/cron/cron.deny</code>:<br />
If this file exists but the <code>/var/cron/cron.allow</code> not, users listed here (one username per line) are disallowed to use cron. All other users are allowed to use cron.</li>
</ul>
<p>If both files do not exist, only root can use crontab. If they exist, but are not readable by crontab, users will be disallowed to use crontab.</p>
<p><strong>Normal users</strong></p>
<p>Normal users can use crontab in the same way as root does. They can also create a file in the correct crontab format and load it by running:</p>
<p><code>crontab &lt;filename&gt;</code></p>
<p>Actually, the systems crontab can be loaded in the very same way, but generally the <code>crontab -e</code> method is preferred.</p>
]]></content:encoded>
			<wfw:commentRss>http://purebsd.com/cron-crontab.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

