Sponsored Content
Full Discussion: Using Stats in Php
Top Forums Shell Programming and Scripting Using Stats in Php Post 302484286 by SkySmart on Thursday 30th of December 2010 11:46:45 AM
Old 12-30-2010
Using Stats in Php

So, I have a php program that i need to delete ALL files in a directory that are older than a certain age.


Code:
<?php
/* Get file stat */
$stat = stat('/apps/security/ajaba');

This is as far as I've been able to get. I know in shell programming you can easily do something like this. but I'm clueless here with this script.

thanks
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

I/O Stats Metrics

What do others use for measuring I/O statistics? I'd like something versatile, as in being able to watch (like iostat, but easier to trend), generate load (like iozone, but more realistic), and perform somewhat generalized benchmarks (like bonnie, but more current.) It would scale from a few... (0 Replies)
Discussion started by: LivinFree
0 Replies

2. AIX

system stats

I recieved this out put below soemhow. Unfortunatly I did not write down the command I used to get it. Can someone tell me what command I use to gather these stats? OS = AIX 5.3 64Bit System Model: IBM,7026-6H1 Machine Serial Number:... (2 Replies)
Discussion started by: rocker40
2 Replies

3. AIX

IO Stats

Aix 5.3 I am trying to view the IO stats. I do the sar 5 5 but that is the WIO and si different than the IO stats right? I am just blanking on this. I know there is a command that I used to run that brings up a whole bunch of live stats that run live such as mem and so on just can't rememeber... (4 Replies)
Discussion started by: rocker40
4 Replies

4. AIX

can I use ps to log overall system stats.

Hi I'm writing a script to get overall system memory and cpu utilization in percentages, much like in top or with AIX's topas. Could I use 'ps' to get the same, I know I can get such results for a particular or group of PIDs but I haven't been able to figure out how I could use 'ps' to give me... (10 Replies)
Discussion started by: thebytegrill
10 Replies

5. Linux

Stats on subdirectories

Please help me with a shell script to get the stats on many subdirectories (sub1), (sub2) etc under a mother directory (big) /big | |_______sub1 |_______sub2 |_______sub3 --------- I want to know 1. What is the last file accessed in each subdirectory with date and by whom 2.... (2 Replies)
Discussion started by: digipak
2 Replies

6. Shell Programming and Scripting

Parse mtr stats

Hi, I am trying to parse mtr stats. On each hop if Loss > 0 then I need to email the entire stats. IFS=' ';for i in `cat mtrres `; do VAL=$(echo $i|awk -F" " '{print $2}' | awk -F"." '{print $1}'); if ; then echo "send email"; exit 0; fi;done Filename: mtrres 192.168.1.10 ... (1 Reply)
Discussion started by: ashokvpp
1 Replies

7. UNIX for Advanced & Expert Users

'time' for disk stats

we all know the time shell command Is there a way to test disk i/o of a process in a similar fashion? I am trying different methods to limit disk writes in a 24/7 daemon process and would like to measure. I know pidstat does it but only to a running process, i want to do one shot test... (7 Replies)
Discussion started by: bigearsbilly
7 Replies
APC_DELETE_FILE(3)							 1							APC_DELETE_FILE(3)

apc_delete_file - Deletes files from the opcode cache

SYNOPSIS
mixed apc_delete_file (mixed $keys) DESCRIPTION
Deletes the given files from the opcode cache. PARAMETERS
o $keys - The files to be deleted. Accepts a string, array of strings, or an APCIterator object. RETURN VALUES
Returns TRUE on success or FALSE on failure. Or if $keys is an array, then an empty array is returned on success, or an array of failed files is returned. EXAMPLES
Example #1 apc_delete_file(3) example <?php $filename = 'file.php'; if (apc_compile_file($filename)) { if (apc_delete_file($filename)) { echo "Successfully deleted file $filename from APC cache.", PHP_EOL; } } if (apc_compile_file($filename)) { if ($good = apc_delete_file(array($filename, 'donotexist.php'))) { var_dump($good); } } $bad = apc_delete_file('donotexist.php'); var_dump($bad); ?> The above example will output something similar to: Successfully deleted file file.php from APC cache. [Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 13. array(1) { [0]=> string(14) "donotexist.php" } [Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 18. bool(false) SEE ALSO
apc_clear_cache(3), apc_delete(3), apc_exists(3). PHP Documentation Group APC_DELETE_FILE(3)
All times are GMT -4. The time now is 08:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy