Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
tuptime.redhat | 2011-06-10 | 1.4 kB | |
tuptime.pl | 2011-06-10 | 9.5 kB | |
tuptime.debian | 2011-06-10 | 999 Bytes | |
README | 2011-06-10 | 3.1 kB | |
Totals: 4 Items | 15.0 kB | 0 |
=============== == tuptime == =============== Tell you how long the system ,or other components, has been running and restarting since this software was installed. == 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. == 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 ------------------ 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 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 human readable values from the begining of the times... # tuptime -m Print the minutes from the begining of the times... # tuptime -u Update and save the values. # tuptime -su Speak wahat are doing when save the values. # tuptime -h Display this help. # tuptime -V Version information. == Contributors ----------------- * Ricardo F <rikr_@hotmail.com> - 2011