-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcron.php
More file actions
39 lines (24 loc) · 975 Bytes
/
cron.php
File metadata and controls
39 lines (24 loc) · 975 Bytes
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
35
36
37
38
39
<?php
include('config.php');
//$value = date("F d Y H:i:s.", fileatime($filename));
//get the 10-digit UNIX timestamp that cron.php was last run
$last = (int)file_get_contents('/home/northe10/public_html/timestamp.txt');
//update with current time
file_put_contents('/home/northe10/public_html/timestamp.txt', time());
//get videos that have been added since last run
$files = glob("/home/northe10/public_html/images/*.mkv");
$num = sizeof($files);
$count = 0;
while ($count < $num) {
$filename = $files[$count];
echo filesize($filename);
if (filemtime($filename) > $last) {
$value = substr($filename,34);
$uploadtime = filemtime($filename);
$size = filesize($filename);
$sql = "INSERT INTO `Session` (`ID`, `Title`, `Room`, `Timestamp`, `Length`, `Patient`, `Clinician`) VALUES (NULL, '$value', '8', '$uploadtime', '$size', '2', '4');";
mysqli_query($db,$sql);
}
$count++;
}
?>