Question: I want to create a cront tab to restart my delayed\_job server if it breaks.

how may check that my delayed\_job server is running or not with ps command?

how may i create a cron tab to check this thing work? Like if my server break than cron tab will restart it. I want to set cront tab to check it every 5 minute.

Answer: 
The right way if you have one delayed\_job process is:

```
#!/bin/bash

if ! [ -s #{pids_dir}/delayed_job.pid ]; then  
  RAILS_ENV=production #{RAILS_APP}/script/delayed_job start  
fi

```
If you don't stick to cron, Monit may be more useful.
<http://mmonit.com/monit/>