I'm running a application using gnu screen and logging everything the the -L flag. The screenlog.n file is being created just fine. What I would like to copy the contents of that file to something like log_<date>
, and then clear the screenlog.n file to start logging the next day. So far I have only found solutions for appending, or leaving the screenlog.n file to keep all the information.
Asked
Active
Viewed 97 times
0

the3rdNotch
- 637
- 2
- 8
- 18
1 Answers
0
I found that screen will create a new screenlog.n file automatically if I delete the existing one while a screen session is detached. I simply scheduled a cronjob to copy and rename the existing file and then delete it. A new screenlog.n file is created as soon as there is something new to log.

the3rdNotch
- 637
- 2
- 8
- 18