Skip to content

Instantly share code, notes, and snippets.

@armanm
Last active December 15, 2015 08:59
Show Gist options
  • Save armanm/5235071 to your computer and use it in GitHub Desktop.
Save armanm/5235071 to your computer and use it in GitHub Desktop.
This is how to run a one off but long running rake task in the background. The ampersand in the end allows to run commands in background mode, but the `nohup` part in the beginning stops the app from receiving termination signal when the SSH session is closed. This allows for the app to run continuously in the background.
nohup rake RAILS_ENV=production rake some_task &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment