<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-7997313029981170997.post249512799651751149..comments</id><updated>2010-01-09T17:36:19.765-05:00</updated><category term='mobile'/><category term='Fedora'/><category term='postgres'/><category term='tools'/><category term='sysadmin'/><category term='pentaho'/><category term='community'/><category term='hosting'/><category term='analytics'/><category term='SELinux'/><category term='perl data-structures json'/><category term='redhat'/><category term='audio'/><category term='travel'/><category term='css'/><category term='git'/><category term='tips'/><category term='nginx'/><category term='Spree'/><category term='cakephp'/><category term='email'/><category term='nosql'/><category term='social-networking'/><category term='unicode'/><category term='performance'/><category term='piggybak'/><category term='eye-candy'/><category term='reporting'/><category term='thrift'/><category term='facebook'/><category term='visualization'/><category term='openbsd'/><category term='mysql'/><category term='scalability'/><category term='riak'/><category term='security'/><category term='CentOS'/><category term='graphics'/><category term='cucumber'/><category term='rvm'/><category term='cloud'/><category term='django'/><category term='remote-work'/><category term='networking'/><category term='wordpress'/><category term='perlbrew'/><category term='optimization'/><category term='book review'/><category term='dropbox'/><category term='sinatra'/><category term='design'/><category term='mp3'/><category term='ruby-and-ruby-on-rails'/><category term='testing'/><category term='open-source'/><category term='json'/><category term='ruby'/><category term='yui'/><category term='virtualization'/><category term='COTS'/><category term='Camps'/><category term='javascript'/><category term='workflow'/><category term='sponsorship'/><category term='perl'/><category term='messaging'/><category term='environment'/><category term='gnu'/><category term='lua'/><category term='rpm'/><category term='browsers'/><category term='configuration-management'/><category term='python'/><category term='ecommerce'/><category term='Conference'/><category term='voldemort'/><category term='image'/><category term='jasper'/><category term='clients'/><category term='dbdpg'/><category term='Android'/><category term='database'/><category term='version-control'/><category term='linux'/><category term='USPS'/><category term='data-warehouse'/><category term='openafs'/><category term='cassandra'/><category term='mondaylinks'/><category term='php'/><category term='Debian'/><category term='monitoring'/><category term='liquid-galaxy'/><category term='audit'/><category term='Bucardo'/><category term='Java'/><category term='mongodb'/><category term='API'/><category term='seo'/><category term='SeniorNet'/><category term='company'/><category term='jquery'/><category term='jobs'/><category term='sql'/><category term='search'/><category term='Ubuntu'/><category term='Interchange'/><category term='caching'/><category term='ipv6'/><title type='text'>Comments on End Point Blog: Best practices for cron</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.endpoint.com/feeds/249512799651751149/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7997313029981170997/249512799651751149/comments/default'/><link rel='alternate' type='text/html' href='http://blog.endpoint.com/2008/12/best-practices-for-cron.html'/><author><name>Jon Jensen</name><uri>http://www.blogger.com/profile/18273388885281263476</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://bp3.blogger.com/_rFXHDrokbpE/SJHpPosaIQI/AAAAAAAAAAM/GnqeZuLItOA/S220/jon1.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7997313029981170997.post-4373389522361150953</id><published>2009-10-07T06:37:46.978-04:00</published><updated>2009-10-07T06:37:46.978-04:00</updated><title type='text'>Greg, this is a very useful article. I&amp;#39;ve used...</title><content type='html'>Greg, this is a very useful article. I&amp;#39;ve used cron for a while and have learned most of the stuff you mentioned through trial-and-error. I don&amp;#39;t use full paths for binaries that are in the cron daemon&amp;#39;s path. When using cron, it&amp;#39;s always good to determine the environment used by cron (* * * * * env &amp;gt; some-file), given the different crons out there. I came across your blog while checking out if people version control their crontab files, as I believe it&amp;#39;s a good practice and I&amp;#39;m introducing a structured way to do so (using SVN) within my Organization. Glad to see version control listed right at the top!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7997313029981170997/249512799651751149/comments/default/4373389522361150953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7997313029981170997/249512799651751149/comments/default/4373389522361150953'/><link rel='alternate' type='text/html' href='http://blog.endpoint.com/2008/12/best-practices-for-cron.html?showComment=1254911866978#c4373389522361150953' title=''/><author><name>Gavin Satur</name><uri>http://itsupport.mrkips.com</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.endpoint.com/2008/12/best-practices-for-cron.html' ref='tag:blogger.com,1999:blog-7997313029981170997.post-249512799651751149' source='http://www.blogger.com/feeds/7997313029981170997/posts/default/249512799651751149' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1635056618'/></entry><entry><id>tag:blogger.com,1999:blog-7997313029981170997.post-1397811285058891776</id><published>2008-12-10T16:26:00.000-05:00</published><updated>2008-12-10T16:26:00.000-05:00</updated><title type='text'>&amp;gt; so what is the advantage of hardcoding the pa...</title><content type='html'>&amp;gt; so what is the advantage of hardcoding the path of /usr/bin/psql&lt;BR/&gt;&lt;BR/&gt;I&amp;#39;ve been burned too many times with having to deal with multiple instances of the psql binary to not hardcode it these days. I agree that things like /bin/cp are overkill though. The noise of long paths is another reason I throw such things in ENVs at the top of the file.&lt;BR/&gt;&lt;BR/&gt;&amp;gt; I have to disagree with the suggestion that one should document the run times for each job. On several occasions I&amp;#39;ve had to track down crazy problems caused by the comment not matching up with the actual job specification, and others were tricked by it too&lt;BR/&gt;&lt;BR/&gt;I still would rather have it spelled out explicitly. Not only does it make it easier to read for non-cron aware people, but it helps you to spot other people&amp;#39;s mistakes. Forcing them to document what they *think* the line is doing is a good way to catch problems. I consider it a checksum. Any mismatch means they entered the specification wrong, cut-n-pasted the wrong entry, or just documented things incorrectly. Whatever the cause, it&amp;#39;s a red flag that should be followed up on. I think it&amp;#39;s worth the danger of readers relying solely on the documentation.&lt;BR/&gt;&lt;BR/&gt;&amp;gt; Do you have any complaints about the now quite common anacron, that lead to your liking fcron for rescheduling jobs?&lt;BR/&gt;&lt;BR/&gt;I don&amp;#39;t like that anacron is not a user-level tool. This makes fcron far superior in my book, as it seems to be a superset of both cron and anacron. Plus, it has some neat bells and whistles like &amp;#39;serial&amp;#39; and &amp;#39;erroronlymail&amp;#39;. Truthfully, I rarely use either one, but I suppose I should simply start promoting fcron rather than making a wishlist for cron. :) Thanks for the reply!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7997313029981170997/249512799651751149/comments/default/1397811285058891776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7997313029981170997/249512799651751149/comments/default/1397811285058891776'/><link rel='alternate' type='text/html' href='http://blog.endpoint.com/2008/12/best-practices-for-cron.html?showComment=1228944360000#c1397811285058891776' title=''/><author><name>Greg Sabino Mullane</name><uri>http://www.blogger.com/profile/01284672712225991979</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.endpoint.com/2008/12/best-practices-for-cron.html' ref='tag:blogger.com,1999:blog-7997313029981170997.post-249512799651751149' source='http://www.blogger.com/feeds/7997313029981170997/posts/default/249512799651751149' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-362101321'/></entry><entry><id>tag:blogger.com,1999:blog-7997313029981170997.post-8211176469594495538</id><published>2008-12-08T20:51:00.000-05:00</published><updated>2008-12-08T20:51:00.000-05:00</updated><title type='text'>Those are excellent notes, Greg.&lt;br&gt;&lt;br&gt;I heartily...</title><content type='html'>Those are excellent notes, Greg.&lt;BR/&gt;&lt;BR/&gt;I heartily second the advice to test a cronjob a few minutes into the future -- it's a real waste to only find out the next day that the nightly job didn't run because cron's environment was different than your own shell, causing a failure.&lt;BR/&gt;&lt;BR/&gt;I've found with vixie-cron, at least, that you have to schedule your test job at least 2 minutes in the future, or it won't run. This is apparently because cron reads jobs one minute in advance, so you need an extra padding minute to get your job in in time.&lt;BR/&gt;&lt;BR/&gt;Speaking of environment, cron usually runs with a fixed PATH set in /etc/crontab, so what is the advantage of hardcoding the path of /usr/bin/psql vs. /bin/cp? Either one could show up somewhere else in the path, but at least on RHEL 5 both are safe without a full path because PATH is simply:&lt;BR/&gt;&lt;BR/&gt;/sbin:/bin:/usr/sbin:/usr/bin&lt;BR/&gt;&lt;BR/&gt;So it seems unless you know your program will be outside that path, there's no particular need to specify, is there? It doesn't hurt, but sometimes the extra noise makes the whole crontab harder to read.&lt;BR/&gt;&lt;BR/&gt;On a similar note, it's helpful to use the fact that cron jobs run cd'd into the user's home directory, so no reason to specify a full path /home/$USER/bin/whatever when bin/whatever will do nicely and survive home directory moves as well.&lt;BR/&gt;&lt;BR/&gt;I have to disagree with the suggestion that one should document the run times for each job. On several occasions I've had to track down crazy problems caused by the comment not matching up with the actual job specification, and others were tricked by it too. I think documenting the implementation (rather than the intent) falls into the category of "don't repeat yourself", and leads to "wrong documentation is worse than no documentation". I now just recommend anyone review "man 5 crontab" who doesn't know crontab syntax.&lt;BR/&gt;&lt;BR/&gt;Do you have any complaints about the now quite common anacron, that lead to your liking fcron for rescheduling jobs?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7997313029981170997/249512799651751149/comments/default/8211176469594495538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7997313029981170997/249512799651751149/comments/default/8211176469594495538'/><link rel='alternate' type='text/html' href='http://blog.endpoint.com/2008/12/best-practices-for-cron.html?showComment=1228787460000#c8211176469594495538' title=''/><author><name>Jon Jensen</name><uri>http://www.blogger.com/profile/18273388885281263476</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://bp3.blogger.com/_rFXHDrokbpE/SJHpPosaIQI/AAAAAAAAAAM/GnqeZuLItOA/S220/jon1.png'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.endpoint.com/2008/12/best-practices-for-cron.html' ref='tag:blogger.com,1999:blog-7997313029981170997.post-249512799651751149' source='http://www.blogger.com/feeds/7997313029981170997/posts/default/249512799651751149' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-932649491'/></entry></feed>
