linux check if process is running send mail

Check if some process is running and send mail when finish.

nohup sh -c ' while true; do s="" ; s=`pgrep rsync` ; [ -z "$s" ] && echo "rsync process done" | mail -s "rsync done" [email protected] && break ; done ' &

Leave a Reply

Your email address will not be published. Required fields are marked *