Problems in Automation

Written on January 2, 2017 has been running automatically since yesterday. This is a short time to run into problems.

The first attempt at automation was a simple manual button procedure. I push a button. Output returns to me. I’m glad and can read the latest news on without needing to manually send it. This is a vast improvement, and I was glad.

The next task was to create a cron job.

This is not my first time using cron. In the past I’ve used cron to auto update clients and run pseudo-daemons. This is one of those times I need to run a pseudo-daemon. My first attempt did not seem to work, as I ran:

$ crontab -e
$ 0 9 * * * bash /home/user/lotro/

I did some research and found a few things. I settled with this procedure that does work.

$ cd /etc/cron.d
$ sudo nano lotroUpdate
[1]0 9 * * * user /home/user/lotro/

The contents of /home/user/lotro/ are:

python /home/user/lotro/
perl /home/user/ -f

When I run within the lotro directory, the following results occur: executes that saves a file to .jlj/queue/ executes that "flushes" all messages in queue, sending it to DW for posting

When cron runs this, it runs the bash script in its own environment.

I did not realize this until I created a log that posted errors from python and perl. Both could not find the files and would not run.

I’m frustrated that I won’t be able to run my bot automatically just yet, but it’s inspiring to know that I now know early-on what I should be looking for. I need constant paths. And I need to be able to call these constant paths within the software itself. Though carrier has yet to be complete, the prototype’s failures can be overcome with new implementation of the modules I’m using.

My first thought was to look at the ConfigParser module to see if they could use some development, but there appears to already be issues that the community has experienced, as expressed here. I also wouldn’t know how to contact the devs and if they already know about the issue of constant paths. The work around in the latter link might come in use.

Take me home.

Check out the archive.