Last active
August 29, 2015 14:18
-
-
Save kas-cor/cd6701cd3767908e4d92 to your computer and use it in GitHub Desktop.
Если panel не позволяет выставить точные настройки Cron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$flag_path = "/path/to/flag.txt"; | |
$runUrl = "http://host.ru/run.php"; // Script to run | |
$runto = "wHi"; // week hours minuts | |
$time = "0180"; // Sunday, 18:00,01,02,03,04,05,06,07,08,09 | |
for($i=0;$i<10;$i++) { $times[$time.$i] = "run"; } | |
if (!file_exists($flag_path) && !empty($times[date($runto)])) { | |
$f = fopen($flag_path, "w"); | |
fwrite($f, "flag"); | |
fclose($f); | |
$body = file_get_contents($runUrl); | |
mail("[email protected]", "Run", $body); | |
} | |
if (file_exists($flag_path) && empty($times[date($runto)])) { | |
unlink($flag_path); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment