Regularly retrieve the process memory and write the log Shell code www.2cto.com $ cat mem. sh #! /Bin/bash LOGFILE = "/xxx/mem. log "date + % Y-% m-% d" "% H: % M: % S >>$ LOGFILE ps aux | grep 'bin/eas. py' | awk '{if ($13 ~ /^ \ W + $/) {print $13, $4} '>>$ LOGFILE $ crontab-l */1 *****/xxx/mem. sh $ crontab-e # edit $ crontab-r # Delete the crontab domain to run the job at a specific time, you need to understand the meaning and format of each domain in each entry of the c r o n t a B file. The following are the fields: minute 1-minute in column 1st ~ 5 9 2nd columns hour 1 ~ 2 3 (0 indicates midnight) 3rd columns 1 ~ 3 1 4th columns Month 1 ~ 1 2 5th columns day of week 0 ~ 6 (0 indicates Sunday) 6th column command Shell code to run 1. $ crontab-l 2.0 * ps aux | grep 'bin/eas. py' | awk '{if ($13 ~ /^ \ W + $/) {print $13, $4} '> "/xxx/mem. log", which runs directly behind crontab