Looking for the latest version? Download tuptime-1.6.2.tar.gz (8.0 kB)
Name Modified Size Downloads / Week Status
Parent folder
changelog 2011-10-17 1.4 kB 0
tuptime.pl 2011-10-17 20.4 kB 0
README 2011-09-30 6.2 kB 0
tuptime.init.d-redhat 2011-09-06 1.5 kB 0
tuptime.init.d-debian 2011-09-06 1.4 kB 0
Totals: 5 Items   30.8 kB
=============== == tuptime == =============== Report how long the system or other components has been running, count it between restarts. Tuptime count: * System starts. * Total uptime that the system is active. * Total uptime of other components. * Medium uptime for the system. * Actual uptime for the system. * Historically time of removed components. == Version ----------------- tuptime 1.5.0 == Requirements ----------------- * perl 5.10 - with modules "Time::Duration", "Sys::Syslog" and "Scalar::Util" == Install ------------ Execute all this commands with privileged user (root). NOTES to RedHat based systems: Install "perl" and "perl-Time-Duration", "perl-Sys-Syslog" and "Scalar::Util" pacakges are in the perl core package. For avoid errors in "perl-Time-Duration" package, 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/). # yum install perl perl-Time-Duration NOTES to Debian based systems: Install the perl modules from CPAN or with the debian pacakge manager: "Sys::Syslog" is in the Perl package core. "Time::Duration" is in libtime-duration-perl package. "Scalar::Util" is in the Perl package core. # apt-get install perl libtime-duration-perl 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 for initialize the files: # /usr/bin/tuptime -i And now, with -u option for update the files: # /usr/bin/tuptime -u Put the init.d script (Debian or RedHat) for udate the counters each time the system starts, restart or stop: In Debian: # cp tuptime.init.d-debian /etc/init.d/tuptime # chmod 755 /etc/init.d/tuptime # update-rc.d tuptime defaults In RedHat: # cp tuptime.init.d-redhat /etc/rc.d/init.d/tuptime # chmod 755 /etc/rc.d/init.d/tuptime # chkconfig --add tuptime Execute this command (with root user) for create a file in /etc/cron.d/ wich automatically update and save the count time every five minutes, is only a safety measure in case of the system had a problem and it can't execute the init script: # echo -e "# /etc/cron.d/tuptime: crontab entrie for tuptime update. \n\nMAILTO=root\n\n*/5 * * * * root if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -u > /dev/null ; fi" > /etc/cron.d/tuptime If you don't want to put the init script, tuptime can work with the previous cron entry, but is less accurate. == Update -------------- Replace only the /usr/bin/tuptime file. # cp /route/to/new/tuptime.pl /usr/bin/tuptime Initialize the files and update: # tuptime -i -u If you upgrade from a version previous 1.5, change the name of the files: # cp /var/lib/tuptime/uptimes /var/lib/tuptime/lastuptime # cp /var/lib/tuptime/starts /var/lib/tuptime/sysstarts # cp /var/lib/tuptime/times /var/lib/tuptime/totaltime == 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 crontab file: # rm /etc/cron.d/tuptime Remove the script: # rm /usr/bin/tuptime == Using tuptime ------------------ Print values in human readable style, any user can do it: # tuptime or: # tuptime -p or, value only 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 If you remove hardware and want a historically print of how many time was running, you can add this special line: ReplacedHardware:12345:RM The special line ends with ':RM' wich indicates that this is a ReMoved hardware. Tuptime will print the name and the time, but not increase or decrease it, simply print the value. For set the value, simply print the time in minutes when you remove the hardware, like this: # tuptime -m OldHardware: 52368 minutes And add to the conf file with the ':RM' end, like this: OldHardware:52368:RM The next time that you run tuptime, the output will be something similar (and a few time ago, the same too): OldHardware Time: 36 days, 8 hours, and 48 minutes The program always print the system starts count, the estimated uptime between starts and the actual uptime for additional info: System Starts, is the count of system starts. Uptime Date, is the date when the system started the last time. Medium Uptime, is the medium uptime between system starts (total time between system starts). Actual Uptime, is the actual uptime for the system. Sample output: $ tuptime System Starts: 79 Uptime Date: 09:07:28 30-Sep-2011 Medium Uptime: 4 hours, 41 minutes, and 14 seconds Actual Uptime: 3 hours, 16 minutes, and 25 seconds System Time: 15 days, 10 hours, 18 minutes, and 4 seconds Memory Time: 1 day, 21 hours, 25 minutes, and 4 seconds == 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-09-30

Thanks for helping keep SourceForge clean.

Screenshot instructions:
Red Hat Linux   Ubuntu

Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Briefly describe the problem (required):

Upload screenshot of ad (required):
Select a file, or drag & drop file here.

Please provide the ad click URL, if possible:

Get latest updates about Open Source Projects, Conferences and News.

No, thanks