Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to put a job on amazon ec2 which is something like delayed job for rails server. The job has to run even when my local machine get disconnected from ec2. Is there any way I can do that. I try screen but the job gets destroyed after sometime when I disconnect from amazon ec2. Any guesses.

share|improve this question

1 Answer 1

use nohup or run from a start up script.

Screen should work and if it doesnt there program exit'ed by itself check its logs

to use screen do

screen -S screen

[YOUR COMMANDS HERE] ctrl+a then d

To re attach

screen -r screen

when you re attach there should be some error message on the screen if the program exited unexpectedly

share|improve this answer
    
Is there any specific way to use screen, I used it may be I used it in some wrong way. can you be bit elaborate on using screen. Initially I used nohup but I don't know why some days after is stops. –  Deepender Singla Dec 19 '13 at 14:28
    
I run the command it was working till sometime but when I logout from the ec2, the command stops working as this command basically send email. When I login to the system -- and did screen -r screen, it actually shows this : 5683.screen (12/19/2013 02:54:39 PM) (Detached) can you tell where I am wrong. –  Deepender Singla Dec 19 '13 at 16:41
    
try screen -r 5683.screen –  exussum Dec 19 '13 at 16:42
    
it is basically showing the email which it sent before, there is also one more thing coming when I do screen -r screen that is :Type "screen [-d] -r [pid.]tty.host" to resume one of them. –  Deepender Singla Dec 19 '13 at 16:47
    
Which program is it ? It should have error logs –  exussum Dec 19 '13 at 16:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.