Home page

homepage.png

Even though I no longer have a hosted web site, I still needed a means of easily accessing my blogs, Twitter accounts, email, and various network devices. I took my old web home page and adapted it as a local web page. I don’t have an intranet server (possibly a future project) so I keep a local copy on all of my local clients (excluding mobile devices). There aren’t many clients so maintaining it isn’t too much trouble.

Now that the idea of building an intranet server has crossed my mind, I’m giving it some serious thought and contemplating how it might serve a number of useful purposes.

A little scripting

About a month ago I created a little bash script to copy an image file from a temporary folder to my journal folders on my PC and Dropbox. The original script worked well enough but it lacked error checking plus I knew I’d have to eventually make changes to use it with next years folders.

The original script took two arguments from the command line, the file to be copied and moved, and the month which designated the appropriate folder. I added a third argument, the four-digit year used in the parent folder. Since the year would be incorporated with in the folder names and the month at the end, I changed the method used to build the folder names using the += operator.

In creating the tests to check the validity of the file to be manipulated and the existence of the created folders, I found it useful to create a function that would print the proper syntax should any of the tests fail.

I also developed a test that after the copy and the move operations checks for the existence of the file in each of the destination folders and displays the operation’s success or failure.

This was a good scripting exercise for me and the first time I’ve used a function in a utility script. I’d like to improve my scripting skills but the tutorials I have have given an elementary understanding but provide little in the way of practical examples and the usage of functions. I’ll be looking for other tutorials to advance my knowledge.

 

%d bloggers like this: