sleep-wake-write-to-file