Reputation: 2890
I have put a long running python program in a cron job on a server, so that I can turn off my computer without interrupting the job. Now I would like to know if the job is correctly started, if it has finished, if there are reasons to stop at a certain point, and so on. How can I do that ?
Upvotes: 1
Views: 1656
Reputation: 300855
You could have it write to a logfile, but as it sounds like this isn't possible, you could probably have cron email you the output of the job, try adding [email protected]
to your crontab. You should also find evidence of cron activity in your system logfiles (try grep cron /var/log/*
to find likely logs on your system).
If you are using cron simply as a way to run processes after you disconnect from a server, consider using screen:
screen
and press returnCtrl+A Ctrl+D
to detatch from the screenThe process continues running even if you log off. Later on simply
screen -r
And you will be will reattached, allowing you to review the script's output
Upvotes: 4
Reputation: 60007
Why not get that cron
job to have a log file. Also just do a ps
before shutdown.
Upvotes: 2