Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: wykyd on September 09, 2003, 06:14:55 AM
-
is there a way to show the systems uptime on a HTML page?
-
Find the PhpSysInfo contrib.
http://wiki.contribs.org/index.php?module=article&view=9&MMN_position=32:32
-
Thanx alot
-
also, this code will let you put it where You want on a Web Page.
$uptime_array = explode(" ", exec("cat /proc/uptime"));
$seconds = round($uptime_array[0], 0);
$minutes = $seconds / 60;
$hours = $minutes / 60;
$days = floor($hours / 24);
$hours = floor($hours - ($days * 24));
$minutes = floor($minutes - ($days * 24 * 60) - ($hours * 60));
$seconds = floor($seconds - ($days * 24 * 60 * 60) - ($hours * 60 * 60) - ($minutes * 60));
$uptime_array = array($days, $hours, $minutes, $seconds);
print("Uptime : " . $uptime_array[0] . " jour(s) " . $uptime_array[1] . " heure(s) " . $uptime_array[2] . " minute(s) " . $uptime_array[3] . " seconde(s)");
?>
-
Patrick,
I am trying to use the exec or "backtick" php operator to execute a unison file synchronization from a php page on a 5.5 server. I can execute "unison -verision" just fine. When I try "unison {preffile}" nothing happens. Is this perhaps a permission problem?
The unison preference files reside in /root/.unison. I note that a php exec command using "ls -al" will only work in the directory in which the php file is located. I have searched for the limitations of exec (or shell_exec, or "backtick") but it is hard to find anything on unison, and specifically for unison on e-Smith.
I have tried to place the simple Unison synchronization command in a .sh script but that also fails to run.
I have used the Unison server-manager addon, but I do not want to turn that over to a user - I just want the "synchronize now" feature so I am trying to duplicate that functionality with a simple unison php page accessible by users' desktops.
I am also looking for an updated Unison rpm (I have 2.7.7) to run on ver 6.0b3. Anyone have a link for this?
Thanks