1

I have already a two python script running on a rpi on startup with crontab, syntax is something like this:

@reboot python /home/scripts/my_script_a.py > /home/log/a.log 2>&1 &
@reboot python /home/scripts/my_script_b.py > /home/log/b.log 2>&1 &

The scripts can take several hours to complete, so by now I'm logging the info, and accesing via sftp to see the output, but I would like to open the process output in a ssh terminal, send commands to the scripts, and see the output in real time, is this possible?

I'm logging in via ssh with the same user as the scripts are running. Thanks for your time.

  • To get their output in realtime, you can very simply do: ssh myRpi tail -f /home/log/a.log – xenoid Jul 29 '17 at 17:32
0

You may find the tailf of tail -f command useful.

For example:

tailf /home/log/a.log

Will print the output in real time.

  • Thank you very much!, i prefer the other solution, but this command will be usefull for me in the future, cheers – Niko Rodriguez Jul 29 '17 at 17:32
0

you can use the screen command to do that.

Check this:

https://serverfault.com/questions/233084/how-do-i-use-crontab-to-start-a-screen-session

  • Thank you very much for your help, i will learn about this screen command, looks very usefull!. – Niko Rodriguez Jul 29 '17 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.