capture process ID of nohup in crontab

How can I capture and store the process ID of a nohup command that run in crontab?

this is my cron

35 * * * * cd /home/ubuntu/aws/&&nohup python3 upload_s3.py >> output_upload_occ.txt

Ideally, I want to know what is process ID given and store it for later analysis

i.e nohup python3 upload_s3.py >> output_upload_occ.txt will give[1] 68585 I want to store this PID into log file.

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like