How to get a return code

Hello,
I have written a Pyton script to upload to Google Drive a file every night. I use the command "rclone check file_name my_drive".

Everything works but I would like to get from rclone a return code in order to send a mail, should there be no machine between the files.

How can I do?

Thanks for helping,
Dan

rclone will return a non zero exit code if it detects problems.

subprocess.call returns the exit code of the program it called. You could use that?

1 Like