From 1e319401f6b8df3558689277047f3558927ea81c Mon Sep 17 00:00:00 2001 From: Tufayel Ahmed <39314838+TufayelLUS@users.noreply.github.com> Date: Wed, 30 Sep 2020 20:29:42 +0600 Subject: [PATCH] Cronjob file to delete local videos if applicable --- cronjob_delete_videos.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 cronjob_delete_videos.php diff --git a/cronjob_delete_videos.php b/cronjob_delete_videos.php new file mode 100644 index 0000000..34ca711 --- /dev/null +++ b/cronjob_delete_videos.php @@ -0,0 +1,32 @@ + $video_name) { + if ($video_name == "index.php") + { + continue; + } + if(!endsWithCheck(".mp4", $video_name)) + { + continue; + } + $create_time = filemtime($video_dir . "/" . $video_name); + if ((time() - $create_time) > $delete_after) + { + unlink($video_dir . "/" . $video_name); + } + } +}