I managed to do fair bit of what I wanted today but playing with other things also reminded me how much you need to know to get the job done.

Yesterday, I declared that today was Hack Day. Overall, I didn't even finish my first task but that's because of two things: (i) coffee, and (ii) refreshing my memory.

All I want a simple cron'd script to do something every 15 mins. As it turns out there is lots more stuff you have to consider for that one ickl' script and it needs a lot more infrastructure than you expect. I ended up using:

  • timezones
  • cron scripts and using dh_installcron
  • logging with Log::Log4perl
  • creating system users in the postinst with id and useradd
  • making sure the package remove and purge works correctly
  • setting up and running logrotate and dh_installlogrotate
  • and not forgetting the actual script itself that's doing all the work

It's funny how a simple script requires all this other padding around it. The good thing is, I've done it the once now so adding further scripts in the future should be easy enough.

I've set it going on my laptop and I'll check the logs tomorrow. If it seems fine so far I'll finish the script off to do the actual database insertions I need.

Phew! Like everything at the moment it's the small things that take the most time.


This post originated on http://chilts.org/.

Email me on andychilton -at- gmail -dot- com.



Published

03 September 2007

Tags