Download Latest Version tuptime-1.6.2.tar.gz (8.0 kB)
Email in envelope

Get an email when there's a new version of tuptime

Name Modified Size InfoDownloads / Week
Parent folder
tuptime.init.d-debian 2011-06-13 1.3 kB
tuptime.init.d-redhat 2011-06-13 1.5 kB
tuptime.pl 2011-06-13 10.6 kB
README 2011-06-13 3.4 kB
Totals: 4 Items   16.8 kB 0
===============
==  tuptime  ==
===============

Report how long the system or other components has been running, count it between restarts.


== Version
-----------------
 tuptime 1.2.0


== Requirements
-----------------
 * perl 5.10 - with module "Time::Duration"  and "Sys::Syslog"



== Install
------------

All this commands with privileged user (root).

Copy the tuptime file in /usr/bin and give it execution permission:
# cp tuptime.pl /usr/bin/tuptime
# chmod 755 /usr/bin/tuptime

Execute it with the -i option:
# /usr/bin/tuptime -i

Put the init.d script (Debian or RedHat):
In Debian:
# cp tuptime.debian /etc/init.d/tuptime
# chmod 755 /etc/init.d/tuptime
# update-rc.d tuptime defaults

In RedHat:
# cp tuptime.redhat /etc/rc.d/init.d/tuptime
# chmod 755 /etc/rc.d/init.d/tuptime
# chkconfig --add tuptime

And optionally, put a line in /etc/crontab:
# echo '45 *    * * *   root    /usr/bin/tuptime -u' >> /etc/crontab


NOTES to RedHat Systems: 
	Install the "perl-Time-Duration" package for avoid errors, is not recommended the use of CPAN for install it because alert some warnings. This package isn't int the official repositories, but in other yes (like http://packages.sw.be/perl-Time-Duration/).

NOTES to Debian System: 
	Install the perl modules from CPAN or with the pacakge manager, Sys::Syslog is in the Perl package core and Time::Duration is in libtime-duration-perl package.


== Update
--------------

Replace only the /usr/bin/tuptime file, all the configuration files will work.
# cp new_tuptime.pl /usr/bin/tuptime



== Uninstall
--------------

Remove the init files and links:
In Debian:
# rm /etc/init.d/tuptime
# update-rc.d tuptime remove

In RedHat:
# chkconfig --del tuptime
# rm /etc/rc.d/init.d/tuptime

Remove the complete directory:
# rm -rf /var/lib/tuptime
# rm -rf /etc/tuptime

Remove the line in the crontab:
# sed -i '/\/usr\/bin\/tuptime/d' /etc/crontab

Remove the script:
# rm /usr/bin/tuptime


== Using tuptime
------------------

Print the default value "System" in human readable style, any user can do it:
# tuptime
or
# tuptime -p
or, value in minutes
# tuptime -m

Update counts values, only root user:
# tuptime -u

Configure your preferred values in the conf file (/etc/tuptime/tuptime.conf), one per line, like next example. All of them have the same time value:
System
Monitor
Mouse

You can add a time value in minutes which decrease of increase the final time, like this:
System
Monitor:+52630
Mouse:-1526

If you add hardware to a running system, you can use (# tuptime -m) to read the time in minutes that the system was running and put the difference time with the new component, like this:
# tuptime -m
System Time:	1931 minutes

and now add in /etc/tuptime/tuptime.conf:
NewHardWare:-1931

If you put a used hardware, you cand add time to it, like the example: (5000 minutes from used hardware - 1931 from system = value to put) like this:
UsedHardware:+3069
 


== Options
------------

Usage: tuptime [OPTION...]

# tuptime -i		Initialize the files which uses.
# tuptime -p		Print the values in human readable style.
# tuptime 		Print the values in human readable style.
# tuptime -m		Print the values in minutes.
# tuptime -u	 	Update and save the values to disk.
# tuptime -v		Verbose output.
# tuptime -h		Display this help.
# tuptime -V	 	Version information.


== Contributors
-----------------
  * Ricardo F <rikr_@hotmail.com> - 2011
Source: README, updated 2011-06-13