Script Naming for run-parts for /etc/cron.daily

I recently added in a new script to the directory /etc/cron.daily so it would be run once a day along with the other scripts in there but for some reason it wasn’t being run. After much messing about I discovered it was the because the name of the script had a . in it.

Specifically the script was called get_xferlog.sh as is common with shell scripts. I changed this to be just get_xferlog and that is now working ok.

The files in /etc/cron.daily are executed as part of an entry in /etc/crontab:-

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts -v /etc/cron.daily )

So it uses the default settings of run-parts to execute all scripts in the directory /etc/cron.daily and the man page for run-parts says.

If neither the –lsbsysinit option nor the –regex option is given then the names must consist entirely of upper and lower case  letters,  digits, underscores, and hyphens.

If you want to check what run parts will do you can use the –test flag which just lists the scripts that will be executed without actually executing them. Thus

run-parts -v –test /etc/cron.daily

This proved very handy in debugging the issue I was having without having to wait a day between tests for the cron job to run.

I should add that the above applies to Ubuntu based servers,  Red Hat servers using run-parts don’t seem to care about a dot in the filename

Advertisements

WordPress Annoyances and Answers.com

The post yesterday about using spaces in samba sharenames highlighted an annoyance with WordPress. For some reason the backslash 040 was causing the zero to be stripped out so instead of seeing My\ 040Documents it was showing jusing My40Documents. (Note I’ve put a space between the \ and the 0 just now to stop it stripping it out.)I tried putting the fstab entries inside a < code > , < /code > block but that made no difference. What I ended up doing was using the extended html codes and put in an ASCII character code in for zero. ASCII/Unicode values can be used in HTML by using the following format ( note however there should be no spaces in the following):-& # x30 ;This is the hexadecimal ASCII code for a 0, I could have done it in decimal making it & # 48 ; but by accident or design the ASCII codes for the digits 0 to 9 are easy to remember in hex as they run consecutively from decimal 48 which is 3 times 16Thus a ‘1′ is decimal 49 or hex x31 , 2 is x32, etc.Using the extended HTML codes was ok but it was sort of a one shot deal. If I saved the post it displayed with \ & # x30 ; showing as \ 0 but if I went back to edit the saved draft then the next save passed the post through the WordPress interpreter and the \ 0 was stripped out. So for each edit I had to go back and put in all the & # x30 ; codes back in.If I missed a trick with WordPress here, please let me know. As I say a < code > < /code > block didn’t help.Having battled with that I then came to mark up the links in my post. I always like to have links in my post to any technical terms or specific products that I mention and I find this a rather laborious task. I therefore tried the WordPress answers.com button which is a quick way to pick out key words from a post and automatically link them to an entry in answers.comUnfortunately for some reason doing that stuck a whole bunch of < div > </div > entries in my post that screwed up all the paragraph formatting. So the time I saved in referencing my post was lost reformatting it, (and typing in all those damn & # x30 ; codes again!)I’m going to try the answers.com link on this post and if it does it again I shall not be using that method of referencing until I’ve asked wordpress.com what the deal is.As for whether answers.com is an appropriate referencing tool well I always check the links confirm what I understand a term to mean. I was a bit dubious about answers.com just leaching of wikipedia and also answers.com having ads but they have an advertising revenue split deal with wikipedia ( or so wikipedia says in 2006…….) . The ads I have seen so far don’t seem to intrusive and annoying so I’ll see how it goes.Right now to press the answers.com button and see what happens to the formatting. Brace yourself………

A year on the blog

Well July 23rd 2007 was the 1st Anniversary of this blog so here are a few facts and figures and a bit of a reflection on what it has meant to me.

The stats:-

Posts = 38

Comments = 38

Views = 5540

Most Views in a Day = 731

Average Days between Posts = 9.6

Average Views Per Day = 15.17

I started this blog as a very small way of making a contribution back to the open source community and in the last year I’ve also become involved with my local LUG and PUG.

I’ve enjoyed writing my blog but I have felt I should have posted more often. I find it quite time consuming writing posts, partly I know because I am so verbose, but also because I like to cross reference links to the things I blog about and it just seems to take me a while to track things down sometimes.

I like to see the graph of the number views of the blog each day that I can get with wordpress, but what I like best of all is getting comments on my blog, especially when people say that my posts have helped them. I guess this is the same with all blog writers.

So what will the next year hold in store for the blog? Well hopefully more of the same and I will try to make posts more often. I have plenty of things I’d like to share about hints and tips I’ve found or experiences I’ve had with Linux I just need to make more of an effort to write them down.

Overall I’d give myself a C- [ Could do better ]