From: Peter Bailey Date: 2008-09-12T21:19:46+09:00 Subject: Re: Scripts dying mid-way Robert Klemme wrote: > 2008/9/12 Peter Bailey : >> Aaaaaaah. My scheduler is set to run every 5 minutes. The first thing >> the script does is copy the files to a sub-directory, so, even if the >> thing executed again within those 5 minutes, there are no files in the >> source directory to act on, so, it doesn't execute. > > Your statement is contradictory. Are files *copied* or *moved*? > >> What's so >> frustrating is that this thing executes just fine in my editor. It works >> perfectly. What's the difference between running it in an editor and >> having it run as a scheduled event? > > You know what's frustrating _me_? You keep on asking the same thing > over and over again and expect answers while nobody knows your > environment and you do not give details. As far as I can see you did > neither mention operating system, ruby version, the type of scheduler > you are using etc. How can you expect us to give reasonable answers > to "it does not work - why?" type of questions? Why don't you add > some logging statements to your script as I suggested to see what it > is doing? > > http://www.catb.org/~esr/faqs/smart-questions.html > > robert I'm very sorry. You're right. I'm on Windows XP, 32-bit. Ruby 1.8.6. The scheduler I use is Splinterware's System Scheduler. It's set up to only execute when there are files in the source directory. Like I said above, the first thing my script does is move the input files. So, it's very rare that there would be new files in the input directory the next time it's scheduled. But, even if there were, it should kick off a new instance of the script. The script executes fine until it gets to the part where it's supposed to copy and move the files, using FileUtils. It works perfectly in the editor, like I said, and, it works perfectly when run from the command shell. -- Posted via http://www.ruby-forum.com/.