I set up an apache2 server on my RPi zero and written cgi script that reads temperature from database and prints it onto a website. To update data in the database, I have a small python script which collects data from BMP180 sensor and writes it to the database (does it every 10 min by cron job).
Now, here comes the trouble: the script needs to have permission to read from /dev/i2c-1. I changed the ownership of this folder to www-data but the ownership is cancelled after each reboot. Is there a way to set the ownership permanently or execute this task in any other way? Doing chmod after every reboot seems like a very bad solution...