jpsc wrote:The file is marked as executable but I explicitly run it with bash -
Sorry, I meant the settings in 'extra files' for processing the file.
I've created a test file similar to yours but simpler:
#!/bin/bash
daylight=<#isdaylight>
if [ $daylight -eq 1 ]
then
ls -al > lsal.txt
fi
and I've got Cumulus processing it like this:
2015-11-25 17_24_43-Cumulus MX.png
I'm executing the output file like this:
2015-11-25 17_26_27-Cumulus MX.png
I've had it running for about four hours now without any errors (but I upload at 5 minute intervals). I'll leave it running to see what happens.
I added some more debug logging to be sure that the file was being processed and copied before the attempt to execute it:
2015-11-25 17:25:00.730 Processing extra file /mnt/samsung/cumulus/testcommand.sh
2015-11-25 17:25:00.732 Finished processing extra file /mnt/samsung/cumulus/testcommand.shtmp
2015-11-25 17:25:00.732 Copying extra file /mnt/samsung/cumulus/testcommand.shtmp
2015-11-25 17:25:00.733 Finished copying extra file /mnt/samsung/cumulus/testcommand.shtmp
2015-11-25 17:25:00.735 Executing program /bin/bash /mnt/samsung/cumulus/testcommandop.sh
2015-11-25 17:25:00.742 External program started
MX copies the file using File.Copy(), which is supposed to be synchronous, but I'm wondering if there is actually some delayed writing going on somewhere which means it hasn't necessarily finished writing it when it's executed (but the system should handle that anyway, even if that is the case). What type of drive are you using - SD card? I'm on a USB hard drive. From your file path it looks like you may be using a USB flash drive?
I'm assuming that you
are copying the file (i.e. you don't have 'ftp' set), and if so then you could try executing the tmp file which MX creates as the result of the processing, before it does the copy. That would eliminate the copy as the cause of the problem.
Something else you could try (if the problem is something to do with delayed file writes) would be to have a static script launched from MX which does a small delay before it then executes the processed script.
You do not have the required permissions to view the files attached to this post.