EC2 ssh broken pipe terminates running process

A simple solution is to send the process to the background by appending an ampersand & to your command:

nohup python myapplication.py > myprogram.out 2>myprogram.err &

The process will continue to run even if you close your SSH session. You can always check progress by grabbing the tail of your output files:

tail -n 20 myprogram.out
tail -n 20 myprogram.err

You should try screen.

Install

Ubuntu:

apt-get install screen

CentOS:

yum install screen

Usage

Start a new screen session by

$> screen

List all screen sessions you had created

$>screen -ls
There is a screen on:
        23340.pts-0.2yourserver    (Detached)
1 Socket in /var/run/screen/S-root.

Next, restore your screen

$> screen -R 23340
$> screen -R <screen-id>