Termux write to SD card
Use termux-setup-storage to setup your storage. 
See https://wiki.termux.com/wiki/Termux-setup-storage for instructions and more information.  Write data will be enabled in the Termux private folder on external storage through ~/storage/external which is a link to Android/data/com.termux/files/ on your external SD card.