Posts Tagged ‘fcron’

My Software Stack 2011 edition

Saturday, December 31st, 2011

I realize that I haven’t written my customary “software stack” post for this year yet. But hey, from where I’m sitting, I still have … 36 minutes to spare ;)

I’ll be using the same categories as last year; system, communications, web, development, office suite, server, organization, and entertainment.


The OS of choice is still Archlinux, my window manager is still wmii, my terminal emulator is rxvt-unicode, upgraded by also installing urxvt-tabbedex.

My shell is still bash, my cron daemon is still fcron, and my network manager is wicd.

To this configuration I’ve added the terminal multiplexer tmux, and have lately found out just how useful mc can be. Oh, and qmv from the renameutils package is now a given part of the stack.


Not much change here, Thunderbird for email, Pidgin for instant messaging, irssi for IRC.

Heybuddy has been replaced by identicurse as my micro-blogging ( client. Heybuddy is very nice, but I can use identicurse from the commandline, and it has vim-like bindings.

For Pidgin I use OTR to encrypt conversations. For Thunderbird I use the enigmail addon along with GnuPG.

This means that Thunderbird still hasn’t been replaced by the “mutt-stack” (mutt, msmtp, offlineimap and mairix) and this is mostly due to me not having the energy to learn how to configure mutt.

I also considered trying to replace Pidgin with irssi and bitlbee but Pidgin + OTR works so well, and I have no idea about how well OTR works with bitlbee/irssi (well, actually, I’ve found irssi + OTR to be flaky at best.


Not much changed here either, Firefox dominates, and I haven’t looked further into uzbl although that is still on the TODO list, for some day.

I do some times also use w3m, elinks, wget, curl and perl-libwww.

My Firefox is customized with NoScript, RequestPolicy, some other stuff, and Pentadactyl.

Privoxy is nowadays also part of the loadout, to filter out ads and other undesirable web “resources”.


In this category there has actually been some changes:

  • gvim has been completely dropped
  • eclipse has been dropped, using vim instead
  • mercurial has been replaced by git

Thanks in no small part to my job, I have gotten more intimate knowledge of awk and expect, as well as beginning to learn Perl.

I still do some Python hacking, a whole lot of shell scripting, and for many of these hacks, SQLite is a faithful companion.

Doh! I completely forgot that I’ve been dabbling around with Erlang as well, and that mscgen has been immensely helpful in helping me visualize communication paths between various modules.

“Office suite”

I still use LaTeX for PDF creation (sorry hook, still haven’t gotten around to checking out ConTeXt), I haven’t really used sc at all, it was just too hard to learn the controls, and I had too few spreadsheets in need of creating. I use qalculate almost on a weekly basis, but for shell scripts I’ve started using bc instead.

A potential replacement for sc could be teapot, but again, I usually don’t create spreadsheets…


Since I’ve dropped mercurial, and since the mercurial-server package suddenly stopped working after a system update, I couldn’t be bothered to fix it, and it is now dropped.

screen and irssi is of course always a winning combination.

nginx and uwsgi has not been used to any extent, I haven’t tried setting up a VPN service, but I have a couple of ideas for the coming year (mumble, some VPN service, some nginx + Python/Perl thingies, bitlbee) and maybe replace the Ubuntu installation with Debian.


I still use both vimwiki and vim outliner, and my Important Dates Notifier script.

Still no TaskJuggler, and I haven’t gotten much use out of abook.

remind has completely replaced when, while I haven’t gotten any use what so ever out of wyrd.


For consuming stuff I use evince (PDF), mplayer (video), while for music, moc has had to step down from the throne, to leave place for mpd and ncmpcpp.

eog along with gthumb (replacing geeqie) handles viewing images.

For manipulation/creation needs I use LaTeX, or possibly Scribus, ffmpeg, audacity, imagemagick, inkscape, and gimp.

Bonus: Security

I thought I’d add another category, security, since I finally have something worthwhile to report here.

I’ve begun encrypting selected parts of my hard drive (mostly my email directory) using EncFS, and I use my passtore script for password management.

And sometimes (this was mostly relevant for when debugging passtore after having begun actively using it) when I have a sensitive file which I for a session need to store on the hard drive, in clear text, I use quixand to create an encrypted directory with a session key only stored in RAM. So once the session has ended, there is little chance of retrieving the key and decrypting the encrypted directory.

Ending notes

That’s about it. Some new stuff, mostly old stuff, only a few things getting kicked off the list. My stack is pretty stable for now. I wonder what cool stuff I will find in 2012 :D


fcron in, dcron out

Sunday, February 6th, 2011

Last month I wrote a post about how I like cron (dcron to be more exact), and this prompted hook to write me a comment about fcron, and how this was, in his opinion, a far superior implementation.

Among his selling points for fcron were that if the computer was powered off during the time a cronjob was scheduled to execute, one could have fcron execute it at the next system start-up instead.

That does indeed seem nifty, but as the really important cronjobs of mine are running on my laptop-turned-server, whose task it is to be up 24/7, those selling points seemed… unnecessary.

But as I had promised I would at least look into it (it didn’t hurt the slightest that hook graciously provided me with a wealth of information about fcron in the form of an article (in German, watch out for Google Translate, it WILL mangle the example fcron syntax in the article) he’d authored, and a post about his own fcrontab).

So I started reading about fcron, and it did indeed seem really nice, but I remained sceptical since dcron was providing me with everything I needed.

One thing I don’t feel is stressed enough in the resources which I have read about fcron is that old dcron entries WILL WORK, out of the box, in fcron as well.

That was a big stumbling block for me personally, the outlook of having to rewrite the entries in my crontab so that they would work in fcron.

Once I realized this wasn’t the case, I warmed up to fcron significantly. I decided to install it on my netbook first, to try it out and get acquainted with it.

From what I have come to understand, fcron can understand three types of syntax; the regular (as seen in dcron) “date specification-based” syntax, a “relative from system boot”-based syntax, and finally the “*ly”-based syntax (hourly, daily, weekly, etc.)

The “relative to system boot”-syntax is pretty smart, and I will probably use that a whole lot, while the “*ly”-syntax seems to me to increase the readability of when stuff will happen, but decrease control over when they actually happen (it would seem fcron only guarantees that a job scheduled to get executed “daily” will be executed daily, some time within the time span of the “day hours”.

I’m sure I will find uses for that type of rules as well, and as one can note from hook’s post, the “*ly”-syntax is the one he use the most.

fcron brings more than this to the table however. One can add options, either to individual entries, or globally.

It wasn’t until I came across these options, and started reading up on them, that I realized that adopting fcron would go down as my best decision of this month.

There are plenty of options, I suggest the MAN page (fcrontab(5)) for reading them all, but the ones that caught my eye for various reasons are:

  • bootrun – for making jobs run at start if they should have ran during downtime
  • first(X) – delay execution of “relative to boot” entry for X minutes
  • lavg(X, Y, Z) – I am not quite clear about how this work, yet, but if the load average (coincidentally I read a great post the other day which explained load averages pretty well (be sure to read the comments though)) is too high, the job is either not carried out, or queued for later execution
  • runas – (only available for root) Have the job execute as another user

Finally, there is one more option of significance to me. The one that makes fcron the best decision of the month: timezone(Continent/City).

Say that you, like me, live in Sweden (timezone Europe/Stockholm) and wish to send an automated good morning message to a friend in New York every morning at 0800 hours. (Yes, this is a VERY contrived example, you’ll have to use your own imagination as to why this might be cool)

If I’d set cron to just send the message at 0800 (Swedish local time) that would be 0200 hours over in New York. Of course, the arithmetic isn’t hard, I could just subtract the six hour time difference and be on my merry way… until daylight savings time… Reading up on that I realize that Europe and the US don’t switch on the same dates, and from what I can gather, not even during the same week.

fcron‘s ability to execute jobs based on a time specification, given the time in another timezone, makes this a complete non-issue (the lines about timezone in fcrontab(5) doesn’t mention it handling DST, but below it there is documentation for the old (which should NOT be used) tzdiff option, which states that tzdiff is stupid, can’t handle DST, but the timezone option will.

And that’s about it, all that is left for me is to again extend a big thank you to hook for recommending it. Rest assured that it has helped me save some time :)


Backing up my crontabs

Tuesday, January 25th, 2011

I haven’t gotten around to replacing dcron with fcron yet. But today, as I was working on a little script that needs to add a cronjob, automatically, I realized that it might be a good thing to add another cronjob which only concerns itself with backing up the cronjobs themselves.

Pseudo-codeish something along the lines of

  1. determine if there is an earlier backup
  2. determine if that earlier backup differs from what the crontab looks like now
  3. if differing: make a new (date-organized) backup, otherwise do nothing

And make a cronjob out of it.

I feel I will have to put some more thought into this, but hopefully I could have something up and kicking before long. :)