I often have 5+ screens open for monitoring the server within one screen and it's somewhat annoying to have setup them all up again after a system restart. Usually there is 1 top process and a few tails for watching log files.
Is there a way to have screen automatically open a number of screens with certain commands executed in each scren?
Yes, you can put this into your screenrc, eg.
You can put the commands in a text file, and then specify that text file as your screenrc, screen will still inherit the entries from the system screenrc file in /etc. The text file might look like:
The Syntax is:
The zombie qr will make it so if you close that window, you can resurrect it by pressing r. To specify the above text file:
If you want to name the screen session, and have reattach the name if there is already a detached session with the same name instead of starting a new one, use -R:
This way, you can save several different text files for different screen sessions.