Save tasks to a file.