Skip to content

Commit ca5cd32

Browse files
author
Ricardo F
committed
Merge branch 'dev'
2 parents c875b8e + 48db99f commit ca5cd32

File tree

17 files changed

+474
-444
lines changed

17 files changed

+474
-444
lines changed

CHANGELOG

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
tuptime (5.1.0) unstable; urgency=low
2+
3+
* Cover DB writes with transactions
4+
* Register DB version on PRAGMA user_version
5+
* Adding --pctl option. Show percentil over average values
6+
* Code refactoring
7+
* Update .deb package
8+
9+
-- Ricardo Fraile <rfraile@rfraile.eu> Sun, 16 Jan 2022 13:09:00 +0100
10+
111
tuptime (5.0.2) unstable; urgency=low
212

313
* Option --decp usable but deprecated
@@ -196,7 +206,7 @@ tuptime (2.5.20) stable; urgency=low
196206
tuptime (2.5.12) stable; urgency=low
197207

198208
* Setting max decimals in the output
199-
* Fix data type for the ok/bad shutdown registry in db wich cause incorrect
209+
* Fix data type for the ok/bad shutdown registry in db which cause incorrect
200210
counter output
201211

202212
-- Ricardo Fraile <rfraile@rfraile.eu> Fri, 07 Aug 2015 11:00:00 -0400

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,13 @@ Or swich to -l | --list option:
7171

7272
* Debian: https://packages.debian.org/tuptime
7373
* Ubuntu: https://packages.ubuntu.com/tuptime
74-
* ArchLinux: https://aur.archlinux.org/packages/tuptime
75-
* CentOS, Fedora: https://copr.fedorainfracloud.org/coprs/frankcrawford/tuptime/
74+
* Fedora, EPEL: https://src.fedoraproject.org/rpms/tuptime
7675
* FreeBSD: https://www.freshports.org/sysutils/tuptime
7776

7877

7978
#### By one-liner script
8079

81-
bash <(curl -Ls https://git.io/tuptime-install.sh)
80+
bash < <(curl -Ls https://git.io/tuptime-install.sh)
8281

8382

8483
#### By manual method
@@ -116,7 +115,7 @@ properly. See 'tuptime-manual.txt' for more information.
116115

117116
- Its main purpose is tracking all the system startups/shutdowns and present that information to the user in a more understandable way. Don't have mail alerts when a milestones are reached or the limitation of keep the last n records.
118117

119-
- It's written to avoid false startups registers. This is an issue that sometimes happens when the NTP adjust the system clock, on virtualized enviroments, on servers with high load, when the system resynchronized with their RTC clock after a suspend and resume cycle...
118+
- It's written to avoid false startups registers. This is an issue that sometimes happens when the NTP adjust the system clock, on virtualized environments, on servers with high load, when the system resynchronized with their RTC clock after a suspend and resume cycle...
120119

121120
- It can report:
122121
- Registers as a table or list ordering by any label.

debian/changelog

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
tuptime (5.1.0) unstable; urgency=low
2+
3+
* Cover DB writes with transactions
4+
* Register DB version on PRAGMA user_version
5+
* Adding --pctl option. Show percentil over average values
6+
* Code refactoring
7+
* Update .deb package
8+
9+
-- Ricardo Fraile <rfraile@rfraile.eu> Sun, 16 Jan 2022 13:09:00 +0100
10+
111
tuptime (5.0.2) unstable; urgency=low
212

313
* Option --decp usable but deprecated
@@ -224,7 +234,7 @@ tuptime (2.5.20) stable; urgency=low
224234
tuptime (2.5.12) stable; urgency=low
225235

226236
* Setting max decimals in the output
227-
* Fix data type for the ok/bad shutdown registry in db wich cause incorrect
237+
* Fix data type for the ok/bad shutdown registry in db which cause incorrect
228238
counter output
229239

230240
-- Ricardo Fraile <rfraile@rfraile.eu> Fri, 07 Aug 2015 11:00:00 -0400

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Priority: optional
44
Maintainer: Ricardo Fraile <rfraile@rfraile.eu>
55
Build-Depends: debhelper-compat (= 13)
66
Rules-Requires-Root: no
7-
Standards-Version: 4.5.1
7+
Standards-Version: 4.6.0
88
Homepage: https://github.com/rfrail3/tuptime
99

1010
Package: tuptime

debian/postinst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ case "$1" in
3838
# Ensure right ownership
3939
if [ -d /var/lib/tuptime ]; then
4040
chown _tuptime:_tuptime /var/lib/tuptime
41+
# When adduser is configured for DIR_MODE=0750,
42+
# the file mode ends up more closed than intended.
43+
chmod 0755 /var/lib/tuptime
4144
if [ -f /var/lib/tuptime/tuptime.db ]; then
4245
chown _tuptime:_tuptime /var/lib/tuptime/tuptime.db
4346
fi

misc/rpm/rpm-readme.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
1.- Install dependencies:
77

88
Latest releases of Fedora, RedHat 8, Centos 8:
9-
dnf -y install rpmdevtools wget python3-rpm-macros python-srpm-macros rpmlint
9+
dnf -y install rpmdevtools wget python3-rpm-macros python-srpm-macros rpmlint systemd python3-devel
1010

1111
Older releases of Fedora, Redhat 7, CentOS 7, install from EPEL:
1212
yum -y install rpmdevtools wget python3-rpm-macros python-srpm-macros
@@ -39,10 +39,11 @@
3939

4040
Z.- For testing with "dev" branch. Install "git" on step "1" and replace step "2" with the following:
4141

42+
dnf -y install git
4243
cd ~
43-
git clone -b dev --depth=1 https://github.com/rfrail3/tuptime.git tuptime-5.0.2
44+
git clone -b dev --depth=1 https://github.com/rfrail3/tuptime.git tuptime-5.1.0
4445
rpmdev-setuptree
4546
cd ~/rpmbuild/SPECS/
46-
cp ../../tuptime-5.0.2/misc/rpm/tuptime.spec .
47-
tar -czvf ../SOURCES/5.0.2.tar.gz ../../tuptime-5.0.2
47+
cp ../../tuptime-5.1.0/misc/rpm/tuptime.spec .
48+
tar -czvf ../SOURCES/5.1.0.tar.gz ../../tuptime-5.1.0
4849
rpmbuild -ba --target=noarch tuptime.spec

misc/rpm/tuptime.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: tuptime
2-
Version: 5.0.2
3-
Release: 5%{?dist}
2+
Version: 5.1.0
3+
Release: 1%{?dist}
44
Summary: Report historical system real time
55

66
License: GPLv2+
@@ -102,6 +102,9 @@ su -s /bin/sh _tuptime -c "(umask 0022 && /usr/bin/tuptime -x)"
102102

103103

104104
%changelog
105+
* Sun Jan 16 2022 Ricardo Fraile <rfraile@rfraile.eu> 5.1.0-1
106+
- Bump new release
107+
105108
* Thu Jan 06 2022 Frank Crawford <frank@crawford.emu.id.au> 5.0.2-5
106109
- First offical release in Fedora
107110

misc/scripts/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tuptime_join.py
1010
Join two tuptime db files into an other one.
1111

1212
tuptime_modify.py
13-
Modify registers keeping nearest values in sycn.
13+
Modify registers keeping nearest values in sync.
1414
Allow change 'end status', 'startup timestamp' and 'shutdown timestamp'.
1515

1616

misc/scripts/runplots.sh

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,44 @@
44
# This script executes all the plots available at the same time
55
# with the same arguments.
66

7-
# Python command
7+
# Defaults
88
PyEx='python3'
9+
Size='22x10'
10+
pDays='30'
11+
EndDT=$(date +"%d-%m-%y")
12+
13+
while getopts s:p:e: flag; do
14+
case "${flag}" in
15+
s)
16+
Size=$(grep -oP '\d+x\d+' <<< ${OPTARG})
17+
;;
18+
p)
19+
pDays=$(grep -oP '\d+' <<< ${OPTARG})
20+
;;
21+
e)
22+
EndDT=$(grep -oP '\d+-\w+-\d+' <<< ${OPTARG})
23+
;;
24+
*)
25+
echo "ERROR: Invalid argument flag" && exit -1
26+
;;
27+
esac
28+
done
29+
30+
# Set X and Y size
31+
Xcm=$(cut -dx -f1 <<< $Size)
32+
Ycm=$(cut -dx -f2 <<< $Size)
33+
XnY="-W $Xcm -H $Ycm"
934

10-
# X and Y wide and height for fit all plots together on the screen
11-
if [ -z "$1" ]; then
12-
XargY='22x10'
13-
else
14-
XargY=`grep -oP '\d+x\d+' <<<$1`
15-
fi
16-
Xcm=`cut -dx -f1 <<< $XargY`
17-
Ycm=`cut -dx -f2 <<< $XargY`
18-
19-
# Days ago
20-
if [ -z "$2" ]; then
21-
Past='30'
22-
else
23-
Past=`grep -oP '\d+' <<<$2`
24-
fi
25-
26-
# End Date
27-
if [ -z "$3" ]; then
28-
EndDate=''
29-
else
30-
EndDate="-e `grep -oP '\d+-\w+-\d+' <<<$3`"
31-
fi
32-
33-
echo "Execution: $0 [Width x Height] [Past Days] [End Date]"
34-
echo "Example: $0 22x10 30 31-Dec-20"
35+
echo "Execution: $0 [-s Width x Height] [ -p Past Days] [ -e End Date]"
36+
echo "Example: $0 -s 22x10 -p 30 -e 31-Dec-20"
3537
echo ""
36-
if [ -z "$XargY" ] || [ -z "$Past" ]; then exit; fi
3738

38-
echo -e "Making 4 plots in backgroud...\n"
39-
echo -e "Wide x Height:\t${Xcm}x${Ycm}"
40-
XnY="-W $Xcm -H $Ycm"
41-
$PyEx ./tuptime-plot1.py $XnY $EndDate -p $Past > /dev/null &
42-
$PyEx ./tuptime-plot1.py $XnY $EndDate -p $Past -x > /dev/null &
43-
$PyEx ./tuptime-plot2.py $XnY $EndDate -p $Past > /dev/null &
44-
$PyEx ./tuptime-plot2.py $XnY $EndDate -p $Past -x
39+
echo -e "Making 4 plots in background...\n"
40+
echo -e "Wide x Height:\t ${Xcm}x${Ycm}"
41+
echo -e "Past Days:\t ${pDays}"
42+
echo -e "End Date:\t ${EndDT}\n"
43+
44+
$PyEx ./tuptime-plot1.py $XnY -e $EndDT -p $pDays > /dev/null &
45+
$PyEx ./tuptime-plot1.py $XnY -e $EndDT -p $pDays -x > /dev/null &
46+
$PyEx ./tuptime-plot2.py $XnY -e $EndDT -p $pDays > /dev/null &
47+
$PyEx ./tuptime-plot2.py $XnY -e $EndDT -p $pDays -x

misc/scripts/tuptime-plot1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ def date_check(arg):
7777

7878
# Set user provided or default end date
7979
if arg.edate:
80-
end_date = dateutil.parser.parse(arg.edate)
80+
end_date = dateutil.parser.parse(arg.edate, dayfirst=True)
8181
else:
8282
end_date = datetime.today()
8383
print('Default end:\tnow')
8484

8585
# Set user provided or default begind date. Days ago...
8686
if arg.bdate:
87-
begin_date = dateutil.parser.parse(arg.bdate)
87+
begin_date = dateutil.parser.parse(arg.bdate, dayfirst=True)
8888
else:
8989
begin_date = end_date - timedelta(days=arg.pdays)
9090
print('Default begin:\tsince ' + str(arg.pdays) + ' days ago')

0 commit comments

Comments
 (0)