Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo F committed Aug 23, 2022
2 parents 4265c1f + e6c0020 commit 6ad7225
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 35 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
@@ -1,3 +1,12 @@
tuptime (5.2.1) unstable; urgency=low

* Set cron file with systemd execute exclusion on .deb package
* Return -e option as an argument for --dec decimals
* Update .deb package
* Update .rpm package

-- Ricardo Fraile <rfraile@rfraile.eu> Fri, 19 Aug 2022 16:21:00 +0100

tuptime (5.2.0) unstable; urgency=low

* Rename timer units to tuptime-sync.timer and tuptime-sync.service
Expand Down
9 changes: 9 additions & 0 deletions debian/changelog
@@ -1,3 +1,12 @@
tuptime (5.2.1) unstable; urgency=low

* Set cron file with systemd execute exclusion on .deb package
* Return -e option as an argument for --dec decimals
* Update .deb package
* Update .rpm package

-- Ricardo Fraile <rfraile@rfraile.eu> Fri, 19 Aug 2022 16:21:00 +0100

tuptime (5.2.0) unstable; urgency=low

* Rename timer units to tuptime-sync.timer and tuptime-sync.service
Expand Down
14 changes: 0 additions & 14 deletions debian/postinst
Expand Up @@ -47,20 +47,6 @@ case "$1" in
fi
fi

# Remove obsolete cron configuration
if [ -f /etc/cron.d/tuptime ]; then
echo -n "Removing obsolete cron configuration... "
rm -f /etc/cron.d/tuptime
echo "done"
fi

# Remove obsolete example files
if [ -d /usr/share/doc/tuptime/examples/ ]; then
echo -n "Removing obsolete example files... "
rm -rf /usr/share/doc/tuptime/examples/
echo "done"
fi

su -s /bin/sh _tuptime -c "tuptime -x"
;;

Expand Down
8 changes: 8 additions & 0 deletions debian/tuptime.cron.d
@@ -0,0 +1,8 @@
# /etc/cron.d/tuptime: crontab entry for tuptime update.

# NOTE: Decrease the execution time for increase accuracity.

# Skip in favour of systemd timer

*/5 * * * * _tuptime if [ ! -d /run/systemd/system ] && [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; fi

6 changes: 3 additions & 3 deletions misc/rpm/rpm-readme.txt
Expand Up @@ -41,9 +41,9 @@ Z.- For testing with "dev" branch. Install "git" on step "1" and replace step "2

dnf -y install git
cd ~
git clone -b dev --depth=1 https://github.com/rfrail3/tuptime.git tuptime-5.2.0
git clone -b dev --depth=1 https://github.com/rfrail3/tuptime.git tuptime-5.2.1
rpmdev-setuptree
cd ~/rpmbuild/SPECS/
cp ../../tuptime-5.2.0/misc/rpm/tuptime.spec .
tar -czvf ../SOURCES/5.2.0.tar.gz ../../tuptime-5.2.0
cp ../../tuptime-5.2.1/misc/rpm/tuptime.spec .
tar -czvf ../SOURCES/5.2.1.tar.gz ../../tuptime-5.2.1
rpmbuild -ba --target=noarch tuptime.spec
5 changes: 4 additions & 1 deletion misc/rpm/tuptime.spec
@@ -1,5 +1,5 @@
Name: tuptime
Version: 5.2.0
Version: 5.2.1
Release: 1%{?dist}
Summary: Report historical system real time

Expand Down Expand Up @@ -102,6 +102,9 @@ su -s /bin/sh _tuptime -c "(umask 0022 && /usr/bin/tuptime -x)"


%changelog
* Fri Aug 19 2022 Ricardo Fraile <rfraile@rfraile.eu> 5.2.1-1
- New release

* Mon Aug 15 2022 Ricardo Fraile <rfraile@rfraile.eu> 5.2.0-1
- New release

Expand Down
2 changes: 1 addition & 1 deletion misc/scripts/tuptime_dbcheck.py
Expand Up @@ -214,7 +214,7 @@ def main():

db_conn = sqlite3.connect(arg.db_file)
db_conn.row_factory = sqlite3.Row
db_conn.set_trace_callback(logging.info)
db_conn.set_trace_callback(logging.debug)
conn = db_conn.cursor()

# Check if DB have the old format
Expand Down
8 changes: 4 additions & 4 deletions misc/scripts/tuptime_join.py
Expand Up @@ -84,13 +84,13 @@ def order_files(arg):
# Open file0 DB
db_conn0 = sqlite3.connect(arg.files[0])
db_conn0.row_factory = sqlite3.Row
db_conn0.set_trace_callback(logging.info)
db_conn0.set_trace_callback(logging.debug)
conn0 = db_conn0.cursor()

# Open file1 DB
db_conn1 = sqlite3.connect(arg.files[1])
db_conn1.row_factory = sqlite3.Row
db_conn1.set_trace_callback(logging.info)
db_conn1.set_trace_callback(logging.debug)
conn1 = db_conn1.cursor()

# Check if DBs have the old format
Expand Down Expand Up @@ -129,13 +129,13 @@ def main():
# Open file0 DB
db_conn0 = sqlite3.connect(fl0['path'])
db_conn0.row_factory = sqlite3.Row
db_conn0.set_trace_callback(logging.info)
db_conn0.set_trace_callback(logging.debug)
conn0 = db_conn0.cursor()

# Open file1 DB
db_conn1 = sqlite3.connect(fl1['path'])
db_conn1.row_factory = sqlite3.Row
db_conn1.set_trace_callback(logging.info)
db_conn1.set_trace_callback(logging.debug)
conn1 = db_conn1.cursor()

# Get all rows from source file0 and print raw rows
Expand Down
2 changes: 1 addition & 1 deletion misc/scripts/tuptime_modify.py
Expand Up @@ -230,7 +230,7 @@ def main():

db_conn = sqlite3.connect(arg.db_file)
db_conn.row_factory = sqlite3.Row
db_conn.set_trace_callback(logging.info)
db_conn.set_trace_callback(logging.debug)
conn = db_conn.cursor()

# Check if DB have the old format
Expand Down
6 changes: 3 additions & 3 deletions src/man/tuptime.1
@@ -1,10 +1,10 @@
.TH TUPTIME 1 "Aug 2022" "5.2.0" "Linux Manual"
.TH TUPTIME 1 "Aug 2022" "5.2.1" "Linux Manual"

.SH NAME
tuptime \- Report historical and statistical real time of the system, keeping it between restarts. Total uptime.

.SH SYNOPSIS
tuptime [\-h] [\-A STARTUP] [\-b] [\-c] [\-d DATETIME_FMT] [\-\-dec DECIMALS] [\-E STARTUP] [\-f FILE] [\-g] [\-i] [\-k] [\-l] [\-n] [\-o TYPE] [\-p] [\-r] [\-s] [\-S STARTUP] [\-t] [\-\-tat TIMESTAMP] [\-\-tsince TIMESTAMP] [\-\-tuntil TIMESTAMP] [\-U STARTUP] [\-v] [\-V] [\-x]
tuptime [\-h] [\-A STARTUP] [\-b] [\-c] [\-d DATETIME_FMT] [\-e DECIMALS] [\-E STARTUP] [\-f FILE] [\-g] [\-i] [\-k] [\-l] [\-n] [\-o TYPE] [\-p] [\-r] [\-s] [\-S STARTUP] [\-t] [\-\-tat TIMESTAMP] [\-\-tsince TIMESTAMP] [\-\-tuntil TIMESTAMP] [\-U STARTUP] [\-v] [\-V] [\-x]

.SH DESCRIPTION
.RS
Expand Down Expand Up @@ -61,7 +61,7 @@ T}
\-d | \-\-date DATETIME_FMT@T{
Datetime/timestamp format output
T}
\-\-dec DECIMALS@T{
\-e | \-\-dec DECIMALS@T{
Number of decimals in percentages
T}
\-E | \-\-exclude STARTUP@T{
Expand Down
8 changes: 4 additions & 4 deletions src/tuptime
Expand Up @@ -24,7 +24,7 @@ from datetime import datetime

DB_FILE = '/var/lib/tuptime/tuptime.db'
DATETIME_FMT = '%X %x'
__version__ = '5.2.0'
__version__ = '5.2.1'

# Terminate when SIGPIPE signal is received
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
Expand Down Expand Up @@ -73,7 +73,7 @@ def get_arguments():
help='datetime/timestamp format output'
)
parser.add_argument(
'--dec',
'-e', '--dec',
dest='dec',
default=2,
metavar='DECIMALS',
Expand Down Expand Up @@ -453,7 +453,7 @@ def gain_db(sis, arg):
else:
logging.info('Making DB file = %s', arg.db_file)
db_conn = sqlite3.connect(arg.db_file)
db_conn.set_trace_callback(logging.info)
db_conn.set_trace_callback(logging.debug)
conn = db_conn.cursor()
conn.execute('BEGIN deferred')
conn.execute('create table tuptime'
Expand All @@ -474,7 +474,7 @@ def gain_db(sis, arg):
logging.info('Getting DB connection')
db_conn = sqlite3.connect(arg.db_file)
db_conn.row_factory = sqlite3.Row
db_conn.set_trace_callback(logging.info)
db_conn.set_trace_callback(logging.debug)
conn = db_conn.cursor()
conn.execute('BEGIN deferred')
except Exception as exp_conn:
Expand Down
8 changes: 4 additions & 4 deletions tuptime-manual.txt
@@ -1,9 +1,9 @@
----------------------
Tuptime Manual
----------------------
version 5.2.0
version 5.2.1
Ricardo F.
02/Aug/2022
19/Aug/2022



Expand Down Expand Up @@ -174,7 +174,7 @@ These are the command line options, no configuration file is used:
-c, --csv csv output
-d DATETIME_FMT, --date DATETIME_FMT
datetime/timestamp format output
--dec DECIMALS
-e DECIMALS, --dec DECIMALS
number of decimals in percentages
-E, --exclude STARTUP
startup numbers to exclude
Expand Down Expand Up @@ -279,7 +279,7 @@ These are the command line options, no configuration file is used:
tuptime -d '%H:%M:%S %d-%b-%Y' # Spanish style


--dec DECIMALS
-e DECIMALS, --dec DECIMALS
Change the decimal length in percentages. The number is rounded to this value.

Examples:
Expand Down

0 comments on commit 6ad7225

Please sign in to comment.