{"id":17069,"date":"2010-04-08T09:53:33","date_gmt":"2010-04-08T15:53:33","guid":{"rendered":"http:\/\/hill-kleerup.org\/blog\/?p=17069"},"modified":"2010-04-08T09:53:33","modified_gmt":"2010-04-08T15:53:33","slug":"wherein-dave-shows-off-his-1337-cron-skillz","status":"publish","type":"post","link":"https:\/\/hill-kleerup.org\/blog\/2010\/04\/08\/wherein-dave-shows-off-his-1337-cron-skillz.html","title":{"rendered":"Wherein Dave shows off his 1337 Cron Skillz"},"content":{"rendered":"<p>Well, not exactly.\u00a0 But I did actually do something modestly clever yesterday, and I want to either brag about it or document it so I can do it again some day.\u00a0 My blog is, of course, my long-term memory &#8230;<\/p>\n<p>So this is all related to the &#8220;Unblogged Bits&#8221; saga (last updated <a href=\"https:\/\/hill-kleerup.org\/blog\/2010\/02\/19\/more-in-the-unblogged-bits-saga.html\">here<\/a>).\u00a0 To summarize, the <a href=\"http:\/\/blog.econtech.selfip.org\/2009\/02\/update-to-google-reader-wordpress-plugin\/\">(modified) Digest Post plugin<\/a> in WP takes my Google Reader shares and posts them here as &#8220;Unblogged Bits&#8221; posts.\u00a0 As it&#8217;s doing it through RSS, it&#8217;s limited to the most recent 20.\u00a0 The DP fires off daily (well, twice daily, but more on that below), which means that if I share more than 20 items during the day, some pushed off the back of the truck and are never seen.<\/p>\n<p>And, yes, the laughter in the studio audience indicates that I frequently share more than that.<\/p>\n<p>When last I&#8217;d checked in, I&#8217;d discovered that I could, through the <a href=\"http:\/\/www.scompt.com\/projects\/wp-crontrol\">Crontrol<\/a> WP plugin, trigger the DP post manually.\u00a0 This was convenient, because I had 5 instances scheduled at 6 p.m. and 5 more at 7 p.m. (and that&#8217;s because, I discovered, every time I modify the DP plugin and save it, it inserts another WP Cron job).<\/p>\n<p>(Cron jobs, btw, are timed activities that take place on the blog.\u00a0 WP has its own cron capability now, so that it doesn&#8217;t have to tie into the server cron tools.\u00a0 But I digress.)<\/p>\n<div class=\"img-shadow-right\"><img decoding=\"async\" src=\"https:\/\/hill-kleerup.org\/blog\/wp\/wp-content\/uploads\/2010\/01\/old-computer-300x234.jpg\" style=\"width: 300px; height: 234px; \" title=\"The Mysteries of the Computer!\"  \/><\/div>\n<p>So I could get around the 20 limitation by manually firing off the DP job through Crontrol, but &#8230; well &#8230; sometimes I forgot. And, of course, that meant that one post I wanted to be <em>sure <\/em>that Margie read was lost into the aether.\u00a0 Drats.<\/p>\n<p>It occurred to me the other day that my problem here was that the DP cron job was set up as a &#8220;Daily&#8221; job (once every 86,400 seconds).\u00a0 I checked out Crontrol again, and found that WP has defined for it Daily, an Hourly, and a Twice Daily interval.\u00a0 Daily and even Twice Daily were too big; Hourly was a bit goofy. But &#8230; Crontrol actually defined the TwiceDaily interval &#8230; and it would let me create new other new cron intervals.\u00a0 Like, say &#8220;FourDaily&#8221; (21,600 seconds, or 6 hours).<\/p>\n<p>So I did.<\/p>\n<p>Then I edited the Digest Post code (since it has no control panel front end) and changed the Daily interval to FourDaily. Did you know, by the way, that there&#8217;s no English occurance word for something that happens four times?\u00a0 It only goes <em>once, twice, thrice <\/em>&#8230; and that&#8217;s it. A shocking gap in our language, if you ask me.)<\/p>\n<p>And, hey presto, it automagically created a new job entry.\u00a0 And, better yet, it has continued to do so.<\/p>\n<p>So now Unblogged Bits posts will automatically be generated four times a day, around 6 a.m.\/p.m. and Noon\/Midnight.\u00a0 I can still do a manual trigger, but it&#8217;s a lot less likely that in any quarter-day interval I&#8217;ll go over 20.<\/p>\n<p>That having been said, a couple of &#8220;Unblogged Bits&#8221; issues remain.<\/p>\n<p>First off, the post names.\u00a0 I want them to be unique (eleventy-dozen posts titled &#8220;Unblogged Bits&#8221; would be confusing), but I really dislike the long date\/time stamps.\u00a0 (Annoyingly, the timestamps are +2 hours from the local post time; that&#8217;s because it&#8217;s based on the time on the server, which is on the East Coast, not the time set for the blog, which is Denver time.) Haven&#8217;t figured out an alternative.<\/p>\n<p>Second, what I&#8217;d really like to do is have scheduled times for the job to fire &#8212; say, 9 a.m. (post early morning GReader browsing), 5 p.m. (wrapping up the day) and 11 p.m. (after an evening grazing the Internet).\u00a0 Since those are intervals of 8, 6, and 10 hours respectively, I can&#8217;t just create a &#8220;Thrice Daily&#8221; cron job.\u00a0 I suppose I could try to get the plugin to fire off three Daily cron jobs at the desired times &#8212; but, then, I&#8217;d then want to be able to name the blog posts &#8220;morning,&#8221; &#8220;evening&#8221; and &#8220;night,&#8221; and the plugin simply won&#8217;t handle that.<\/p>\n<p>(An alternative would be to try and reset the base time and do a Thrice job at 9 a.m., 5 p.m. and 1 a.m.\u00a0 That&#8217;s doable, though I still wouldn&#8217;t have the desired title control.)<\/p>\n<p>Anyway, that&#8217;s were things currently stand.\u00a0 And since the Unblogged Bits are, ironically, an increasingly large portion of the content blogged here, I guess it&#8217;s a good thing I&#8217;m getting more of a handle on them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, not exactly.\u00a0 But I did actually do something modestly clever yesterday, and I want to either brag about it or document it so I can do it again some day.\u00a0 My blog is, of course, my long-term memory &#8230; So this is all related to the &#8220;Unblogged Bits&#8221; saga (last updated here).\u00a0 To summarize, &hellip; <a href=\"https:\/\/hill-kleerup.org\/blog\/2010\/04\/08\/wherein-dave-shows-off-his-1337-cron-skillz.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Wherein Dave shows off his 1337 Cron Skillz&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_analysis_target_kw":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[55],"tags":[],"class_list":["post-17069","post","type-post","status-publish","format-standard","hentry","category-blogging-technical"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":16767,"url":"https:\/\/hill-kleerup.org\/blog\/2010\/02\/19\/more-in-the-unblogged-bits-saga.html","url_meta":{"origin":17069,"position":0},"title":"More in the &#8220;Unblogged Bits&#8221; saga","author":"***Dave","date":"Fri 19-Feb-10 6:55am","format":false,"excerpt":"When last we left \"Unblogged Bits,\" I was trying to figure out why (a) sometimes it didn't fire off, (b) other times it fired off multiple times, (c) it was firing off at both 5 p.m. and 6 p.m. for a prolonged period.\u00a0 \"It\" being a specially-modified (for Google Reader\u2026","rel":"","context":"In &quot;Blogging - Technical&quot;","block_context":{"text":"Blogging - Technical","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging\/blogging-technical"},"img":{"alt_text":"imgTag","src":"https:\/\/i0.wp.com\/hill-kleerup.org\/blog\/wp\/wp-content\/uploads\/2010\/01\/old-computer-300x234.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":16283,"url":"https:\/\/hill-kleerup.org\/blog\/2009\/11\/25\/changing-how-i-do-the-unblogged-bits.html","url_meta":{"origin":17069,"position":1},"title":"Changing how I do the Unblogged Bits","author":"***Dave","date":"Wed 25-Nov-09 9:50am","format":false,"excerpt":"So as noted elsewhere, I'm testing changes in how I'm generating the \"Unblogged Bits\" parts of my blog, where I archive here the links I share in Google Reader (and the copious notes from them). The previous tool I've been using is a WP plugin called Digest Post, with mods\u2026","rel":"","context":"In &quot;Blogging - Technical&quot;","block_context":{"text":"Blogging - Technical","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging\/blogging-technical"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19824,"url":"https:\/\/hill-kleerup.org\/blog\/2011\/01\/11\/unblogged-bits-tue-11-jan-11-2230.html","url_meta":{"origin":17069,"position":2},"title":"Unblogged Bits (Tue. 11-Jan-11 2230)","author":"***Dave","date":"Tue 11-Jan-11 10:30pm","format":false,"excerpt":"Links (most recent first) that caught my eye, but did not warrant full-blown blog entries .... Nerds - I'd say this is the kind of cruise that I'd want to go on ... but it's good to know it's the kind of cruise I'd bring with me.","rel":"","context":"In &quot;Potpourri&quot;","block_context":{"text":"Potpourri","link":"https:\/\/hill-kleerup.org\/blog\/category\/potpourri"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19875,"url":"https:\/\/hill-kleerup.org\/blog\/2011\/01\/16\/unblogged-bits-sun-16-jan-11-1631.html","url_meta":{"origin":17069,"position":3},"title":"Unblogged Bits (Sun. 16-Jan-11 1631)","author":"***Dave","date":"Sun 16-Jan-11 4:31pm","format":false,"excerpt":"Links (most recent first) that caught my eye, but did not warrant full-blown blog entries .... E-readers: Amazon Kindle, Sony Reader make it harder to remember what you've read | Mail Online - I'd never considered whether reading everything in the same form factor and font on an ereader might\u2026","rel":"","context":"In &quot;Potpourri&quot;","block_context":{"text":"Potpourri","link":"https:\/\/hill-kleerup.org\/blog\/category\/potpourri"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16648,"url":"https:\/\/hill-kleerup.org\/blog\/2010\/02\/03\/it-is-in-fact-possible-to-share-too-much.html","url_meta":{"origin":17069,"position":4},"title":"It is, in fact, possible to Share too much","author":"***Dave","date":"Wed 3-Feb-10 5:08pm","format":false,"excerpt":"I've been researching and struggling with a problem in my Unblogged Bits.\u00a0 I noticed the other day that ... not everything I'd Shared in Google Reader was showing up in my nightly post. Hmmm. Presently what happens is that there's an Atom feed from Google Reader for my Shared items\u2026","rel":"","context":"In &quot;Blogging - Technical&quot;","block_context":{"text":"Blogging - Technical","link":"https:\/\/hill-kleerup.org\/blog\/category\/blogging\/blogging-technical"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19589,"url":"https:\/\/hill-kleerup.org\/blog\/2010\/12\/16\/unblogged-bits-thu-16-dec-10-0430.html","url_meta":{"origin":17069,"position":5},"title":"Unblogged Bits (Thu. 16-Dec-10 0430)","author":"***Dave","date":"Thu 16-Dec-10 4:30am","format":false,"excerpt":"Links (most recent first) that caught my eye, but did not warrant full-blown blog entries .... Our Daily Bleg: How to Get Firefighters to Wear Seat Belts? - It's fascinating that folks involved in saving lives would eschew (and even actively avoid\/bypass) something that clearly saves lives.","rel":"","context":"In &quot;Potpourri&quot;","block_context":{"text":"Potpourri","link":"https:\/\/hill-kleerup.org\/blog\/category\/potpourri"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/posts\/17069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/comments?post=17069"}],"version-history":[{"count":0,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/posts\/17069\/revisions"}],"wp:attachment":[{"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/media?parent=17069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/categories?post=17069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hill-kleerup.org\/blog\/wp-json\/wp\/v2\/tags?post=17069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}