I have a rake task that requires several hours to run. I logged into my server, ran there the rake task and watched the outputs generated inside the terminal window.
Then my internet connection broke. Is there now a way to see the live output of the rake task?
Try the following:
- Find the PID of your running rake command
- Attach terminal to the last logs of the output of that process
tail -f /proc/{PID}/fd/1
Next time you could start a rake task in a session of such utils as tmux
and screen
, this way your terminal session would be stored even after connection break.
Alternatively, you could write your rake task output to a file (you can configure Rails.logger
to do it)