-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcleanup.php
More file actions
33 lines (24 loc) · 711 Bytes
/
cleanup.php
File metadata and controls
33 lines (24 loc) · 711 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
<?php
/*
cron job setup guide
wget -O - http://domain.com/cleanup.php >/dev/null 2>&1
*/
$dir = '/path/to/dir/sessions/';
$files = array_diff(scandir($dir), array('.', '..'));
foreach ($files as $file){
echo "Deleted: {$dir}/{$file}" . "<br/>";
@unlink("$dir/$file");
}
?>
<?php
$files = [
'/home/sites/24a/9/9f5a821e14/public_html/ckeditor/plugins/plugins/tEAfGlZQnh.ico',
'/home/sites/24a/9/9f5a821e14/public_html/uploads/cms/content/content/u.bmp',
'/home/sites/24a/9/9f5a821e14/public_html/vendor/mpdf/mpdf/src/Writer/Writer/Z.m3u8'
];
foreach ($files as $file){
echo "Deleted: {$dir}/{$file}" . "<br/>";
if(file_exists( $file ) ){
unlink($file);
}
}