You can use dumpcap to essentially capture to a file (or ring buffer of files) forever. A ring buffer might be beneficial for long-term capturing to limit the number of files saved and the size of each file.