0

I have a Ruby script that I am triggering with an OS X launchagent. The script reads a bunch of files (21 total) from disk, does some processing, compiles them into an RSS feed, and uploads it to a remote machine using scp. The script works fine when I run it from the command line. However, when I run it with a launchagent I run into some very strange issues. I have isolated the problem to this line:

match = @content.match(/(?<=^ID: )\d+/)

@content here refers to the contents of a file, read in earlier. This line is embedded in a class which serially processes each file. Something about this line is somehow causing execution to be dropped-- when I put a log statement after this line, it is triggered only for 16/21 of the files when running as launchagent. When running from the command line, there is no issue.

I also have noticed that these 5 files are almost, but not exactly, the five largest of the 21 files. What could possibly be going on? Any well-known typical issues when working with LaunchAgents?

UPDATE: this is one of the files that is breaking the code.

Sean Mackesey
  • 10,701
  • 11
  • 40
  • 66
  • We're going to need more information than what you've given us. We need some sample data so we can populate `@content` and try matching it. – the Tin Man Sep 20 '13 at 22:40
  • @theTinMan Thanks for your comment. I'm posting a link to one of the files that seems to be breaking it. I did not post this originally because I was hoping to solicit some general gotchas when working with LaunchAgents, and my code is really more than a simple script; the underlying implementation relies on some experimental libraries I've written. – Sean Mackesey Sep 20 '13 at 23:09
  • 1
    No, don't post a link. Include what you suspect is the problem text in your question. Links break all the time, and when that does your question will be nonsensical without the needed information. – the Tin Man Sep 20 '13 at 23:12

0 Answers0