Hi Scott,
You can try a few things here.
The database files from your post indicate that only the www-data user
has read-write access. If you are running the backgroundprocess.php
file as a user other than www-data, that could be the source of this
problem. Also, sqlite needs the ability to create temporary files
within the database folder. So the folder itself must have read-write
access as well.
I would try
chmod -R 777 /var/local/cowtacular
That will set the cowtacular folder and it's contents read/writable by
everyone. If that solves your problem and you want to secure it a bit
better. You should add the users who would be accessing that data to
the www-data group (for example) and then chmod -R 770 /var/local/
cowtacular
Hope that helps.
- Chris