
This started to become a problem for me when was running a monitoring script which wrote to a file every 10 mins. After seeing SD Card failures I opted to move the OS to a USB and run off the usb just like you can on a full computer as detailed in https://www.chris-shaw.com/blog/install-ubuntu-16.04-persistently-on-a-usb-drive
Raspbian Img : https://www.raspberrypi.org/downloads/raspbian/
Rufus : https://rufus.akeo.ie/