Skip to content

Instantly share code, notes, and snippets.

@justinmklam
Last active April 24, 2020 20:10
Show Gist options
  • Save justinmklam/8f23bd9e81be3b530591434665ccc4f9 to your computer and use it in GitHub Desktop.
Save justinmklam/8f23bd9e81be3b530591434665ccc4f9 to your computer and use it in GitHub Desktop.
Cheat sheet for launching detached screens (ie. via crontab)
# Starts a detached screen and logs to a datestamped log file. '%' characters only need to be escaped if running this command via cron
screen -L -Logfile ~/my/log/path/$(date +\%Y-\%m-\%d_\%H-\%M-\%S).log -dm <command>
# Execute multiple commands in a detached screen session
screen -dm /bin/bash -c "command1 | command 2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment