forked from KIMB-technologies/Radio-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcron.php
34 lines (31 loc) · 806 Bytes
/
cron.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/local/bin/php
<?php
/**
* Radio-API
* https://github.com/KIMB-technologies/Radio-API
*
* (c) 2019 - 2022 KIMB-technologies
* https://github.com/KIMB-technologies/
*
* released under the terms of GNU Public License Version 3
* https://www.gnu.org/licenses/gpl-3.0.txt
*/
define('HAMA-Radio', 'Radio');
error_reporting(E_ALL);
require_once( '/php-code/classes/autoload.php' );
/**
* Dumps known episodes to disk (json-file).
*
* docker exec --user www-data radio_api php /cron.php
*/
Config::setRedisServer();
if( trim(shell_exec("whoami")) != "www-data" ){
die("Run as user www-data!" . PHP_EOL);
}
if( UnRead::dumpToDisk() ){
echo "Dumped (Un-)Read at " . date("d.m.Y H:i:s") . PHP_EOL;
}
else{
echo "Error while dumping (Un-)Read at " . date("d.m.Y H:i:s") . PHP_EOL;
}
?>