cron script: add cron config in comments

This commit is contained in:
2020-04-10 14:16:07 +02:00
parent b2189fd8a1
commit f04fe46502

View File

@@ -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;
} }