Code:
#!/bin/bash
#imgct.sh
#FTP and CHMOD 755
find . -name "*.jpg" -or -name "*.gif" -or -name "*.png" | wc -l >ct.txt
exit
The bash script should start in the parent folder of the images -- it will recurse the sub directories from there.
You may have to path the PHP script to the ct.txt file.
crontab
there shold be access in the admin interface (cPanel?)
Quote:
*/10 * * * * /home/user/path/../../imgct.sh
#every 10 min
#30 18 * * *
#each day at 6:30 PM^
|
Crontab ? Quick Reference | Admin's Choice - Choice of Unix and Linux administrators
PHP Code:
<?php
//display count
//displayct.php
$imgct = fopen("ct.txt", "r") or die("Unable to open file!");
echo fread($imgct, filesize("ct.txt"));
fclose($imgct);
?>
You could make this PHP an include in the file you want it in. Path shown is relative to the .sh You will need to change the path from the template page or PHP file it is put on.
Freeware: MIT license as-is without warranty or guarantee.
