You can wrap the pipe in the attic with heat tape and insulation and connect it to a T-Stat so if it gets below freezing the heat tape will come on automatically.Yeah i only use it to protect hot water pipes in uninsulated attic space in small basement walkout addition. I wish we moved that small run of iron pipe under the ceiling and had them exposed rather that leaving them in the small attic space. Bad move by us. But i still do need heat for the whole house when i'm away, which is a few weeks a year in winter.
I did that in 2 of my neighbors un-Heated garages so their pipes would not freeze and they have had no freezing in many years.
The tape is really not on very long so it does not take much electricity at all!