Skip to content

Instantly share code, notes, and snippets.

@battis
Last active February 19, 2018 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save battis/25dd7c704310e644c147f06041e5e7e5 to your computer and use it in GitHub Desktop.
Save battis/25dd7c704310e644c147f06041e5e7e5 to your computer and use it in GitHub Desktop.
Start TT-RSS daemon in a detached screen (a 'cheap daemon' on multiuser servers)
#!/usr/bin/expect -f
set screen "tt-rss"
set prompt "$"
set ttrss "~/public_html/tt-rss"
# open a new screen (reusing any existing 'tt-rss' screen)
spawn screen -D -R "$screen"
expect "$prompt"
# start the tt-rss multithreaded daemon script
send "php $ttrss/update_daemon2.php\n"
# detach from the 'tt-rss' screen (\x01 == ctrl-A)
expect "All done."
send "\x01"
send "d"
interact
@battis
Copy link
Author

battis commented Feb 19, 2018

One could, of course, instead use nohup:

nohup php ~/public_html/tt-rss/update_daemon.php &>/dev/null &

The downside of this approach is that you can't examine the output at will as it is running. (And, if redirected to a log file, it would then turn into a log-rotation issue. Blergh.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment