Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently set up a Newznab server on Ubuntu Server 12.04 (nothing illegal, just TV shows as I prefer to use XBMC instead of Tivo) and I'm having some trouble at the very final step.

I can run my update scripts manually with no issue, but I would like to have them run automatically when my server reboots as well as iftop to monitor bandwidth. I've added the following line to rc.local:

screen sh "path to update script"

That starts the script when I reboot, but it outputs amongst the startup messages (Starting Apache [OK] etc) and once I login I can no longer see any output, screen reports no sessions to retrieve. After Googling I tried

screen -AmdS test bash -i "path to update script"

And various variations of the same, but this appears to have no effect. Once I login and try screen -r I am told there are no screen sessions to retrieve. I can't make sense of other suggestions that refer to cron sessions and other technical sounding stuff.

Can anybody give me any help on setting this up so that I can have the screen session started and retrievable? I've been Googling for a few days trying to figure this out but can't find what I need.

share|improve this question
Why do you want to use screen? – terdon Apr 13 '13 at 16:49
My Newznab server is on my Homeserver box in a Virtual Machine. Using Screen seems a good way to be able to "park" the session and retrieve it whether I'm remoting to my Homeserver or SSH'ing from somewhere else in the house. I think I've found a way around this, will post below – diberlee Apr 13 '13 at 18:50
I've found a way to do this as I wanted. The first couple of places I looked said do not use Cron for this task so I looked for solutions without cron. I revisited it and it seems a perfectly valid way to accomplish what I wanted. If I'm wrong maybe somebody can tell me otherwise, but here's what I did... "crontab -e" to open crontab config and added a line as follows @reboot screen -d -m sh path_to_update_script I tested this and when I reboot the update script is started in Screen exactly as I wanted. I'm open to suggestions on a better way to do this, but this seems fine for my needs – diberlee Apr 13 '13 at 18:59

You must log in to answer this question.

Browse other questions tagged .