A few days ago wrote a restart Chatterserver script, and set up a scheduled task, two points per day to execute, by checking the chatterserver process PID discovery, the next morning the PID is the same, that is, the scheduled task did not execute successfully.
The initial analysis of the crontab grammar problems, but after repeated inspection did not find the problem, on the CentOS test no problem, so look at it or Ubuntu and CentOS is not the same reason, because it is not familiar with Ubuntu, The default Crontab scheduled task for the shell is/bin/sh, and/bin/sh is a linked file, which essentially points to/bin/dash (as shown), because/bin/dash is very different from/bin/bash in some syntax, if/bin/ Dash executes some scripts that start with #!/bin/bash will inevitably go wrong, so you need to reassign this sh.
650) this.width=650; "title=" image "style=" border-right-width:0px;border-bottom-width:0px;border-top-width:0px; " Border= "0" alt= "image" Src= "http://s3.51cto.com/wyfs02/M01/6F/E7/wKiom1WsyYCChR42AAMaFyXXFjo511.jpg" width= "833" height= "408"/>
But in order not to affect the entire crontab, I specified the custom crontab as bash to execute, as shown in:
650) this.width=650; "title=" image "style=" border-right-width:0px;border-bottom-width:0px;border-top-width:0px; " Border= "0" alt= "image" Src= "http://s3.51cto.com/wyfs02/M02/6F/E7/wKiom1WsyYCjaFNcAABJcoAJ1i0772.jpg" width= "649" Height= "/>"
This way, lines that are incompatible with dash in the chatter.sh script can be executed correctly.
--end--
This article is from "Communication, My Favorites" blog, please make sure to keep this source http://dgd2010.blog.51cto.com/1539422/1676490
Solve the problem that crontab can't execute script correctly under Ubuntu