Is there a simple way for me to add a shell command to a list of jobs to have run on the system when I'm not logged in?

For example:

I SSH into my system, decide that I want to read an ebook later, but it's in the wrong format. I'll use Calibre to convert it, but this will take up the CPU for many minutes. I'm in no rush though, so I would like to tell my system to start the Calibre convert operation (just running a shell command) as soon as I log out of my SSH session. Then later when I SSH in again, my converted book will be waiting for me.

3 Answers 3


A simple, but possibly inconvenient method is to start the command with nohup to detach it from the terminal, just before logging out.

nohup mycommand &

Any output from the command is sent to the file nohup.out in the current directory.

It is usually more convenient to run the command inside screen or tmux. Both programs provide a terminal within a terminal, and you can detach your session from the current terminal and reattach to it later.

# inside the screen session
sleep 60; mycommand
# press Ctrl+A D to detach from the session
# now back in the original shell

Then later:

screen -rd
# inside the screen session, you can see how your command is doing

Another possibility is to schedule the job for later. The at command lets you schedule a job at a specific time (it's the once-off pendant of cron for regularly scheduled tasks). If the command produces output, it'll be mailed to you (assuming you have local mail running).

echo 'mycommand' | at 23:05

I'd just start a screen (nowadays accessed as 'byobu'), or tmux session. Do your stuff, and start the process, then disconnect. The job will continue to run, an when you are ready, you can reconnect, and get back into the session. I've had screen sessions running for months, and they can be pre-configured so that wneh


Use the at command to submit a batch job for processing. It won't wait for you to logout before running it though, so when you submit the job just make sure it's niceed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .