1. When the crontab command is executedProgramIt is a little different and should be noted. For example, PS aux | grep File
If the statement is executed directly in shell, the search scope is only the process currently executed in top, and the crontab statement is written to execute, all statements in crontab become the search range.
Count = 'ps aux | grep file | WC-l'
2. Add/bin/sh in front of the written script
If you want to grant the script execution permission, the first line must declare the script's explanation. For example:
#! /Usr/local/PHP/bin/PHP
#! /Bin/sh
The effect is as follows:/bin/sh scriptname
"#! /Bin/sh "is the shell declaration, indicating that you are using the shell type and its path. It can be understood #! It is a special declaration character.
Reference
[1]Http://linux.die.net/man/1/head
[2] About/bin/sh
Http://www.cnblogs.com/ghj1976/archive/2010/07/12/1775860.html