cron script: add cron config in comments
This commit is contained in:
@@ -173,7 +173,12 @@ class Spot extends Main
|
|||||||
|
|
||||||
public function genCronFile() {
|
public function genCronFile() {
|
||||||
//$bResult = (file_put_contents('spot_cron.sh', '#!/bin/bash'."\n".'cd '.dirname($_SERVER['SCRIPT_FILENAME'])."\n".'php -f index.php a=update_feed')!==false);
|
//$bResult = (file_put_contents('spot_cron.sh', '#!/bin/bash'."\n".'cd '.dirname($_SERVER['SCRIPT_FILENAME'])."\n".'php -f index.php a=update_feed')!==false);
|
||||||
$bResult = (file_put_contents('spot_cron.sh', '#!/bin/bash'."\n".'wget -qO- '.$this->asContext['serv_name'].'index.php?a=dummy > /dev/null')!==false);
|
$sFileName = 'spot_cron.sh';
|
||||||
|
$sContent =
|
||||||
|
'#!/bin/bash'."\n".
|
||||||
|
'wget -qO- '.$this->asContext['serv_name'].'index.php?a=dummy > /dev/null'."\n".
|
||||||
|
'#Crontab job: 0 * * * * . '.dirname($_SERVER['SCRIPT_FILENAME']).'/'.$sFileName.' > /dev/null'."\n";
|
||||||
|
$bResult = (file_put_contents($sFileName, $sContent)!==false);
|
||||||
return $bResult?self::SUCCESS:self::ERROR;
|
return $bResult?self::SUCCESS:self::ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user