OK let’s do this

If watching Iron Man last night has made me realize anything, it’s that I need to finish this radio playlist project so I can start building my own arc reactor. I’ve been spending all my time as of late destroying GTA4 and it’s time to get back to work.  So let’s DO THIS!

When I last left off, there was something weird happening with the bash script. For some reason the at job would start it, but it would have problems. Since it’s running in the background and there’s no logging going on, I have no idea what the problem is. The first thing I’m doing today is adding some logging features. I’ll just have it echo some stuff out to a file in the same directory so I can see what’s going on.

So I’ve added some logging lines and I’ve also altered the Perl script to add the at job immediately instead of waiting 30 minutes. This change is only temporary. I don’t want to have to wait 30 minutes for each test. Now I just wait 3 minutes for the cron job to start and we’ll see what happens.

Well that didn’t work. No log was created. This means that either none of the logging lines ran at all, or I have to give the full path to where the log is. I’m not sure. I’ll try adding the full path and see what happens after that.

That didn’t work either. It seems like nothing is happening at all. I’m going to try to set the at job manually and see what happens.

That seems to have started working… but not completed. AHA! The log shows that the the script is not getting the input arguments. It seems like at has no way of providing arguments. I tried using double quotes and single quotes around the entire command to no avail. I’m not really sure how to handle this problem. I need a way of sending the time to the bash script but I’m not sure if ‘at’ can do it. Also, it’s really hard to do a Google search for ‘at’ so I’m not sure how to find that out… Perhaps my handy dandy ginormous Unix manual has something to say about this… Not really.

I figured it out! Thanks to this page I found. I can send arguments to the at command by calling it like this:

echo “command arg1 arg2 arg3″ | at -t time

I tested it out and it works. Now I can just change the Perl script to reflect this and we shall see what happens.

That fixed THAT problem. Finally. Although now there are more problems. Luckily, the at command sends mail to my user when something goes wrong. Based on the error messages I received, I forgot to include the full path to the downloaded html code. I changed that and everything finally works! Now I have to figure out why the emails are not being deleted when I set them to be.

I’m having trouble figuring this out.  It only deletes the e-mails if I put the Delete command before the IF statements.  However this makes it so the IF statements do not work at all.  I’m taking a break from this for the rest of the night.  Until tomorrow…

Leave a Reply