Part of the Furniture
the error is exactly as i suspected. posix/bash multiplication can't handle the large number that results from multiplying. I'll patch in a fix today@Jack Yaz I checked on the code and propose the following modification to the code base.
FROM (LINE 1192):
if [ "$SIZEDB" -gt "$((SIZEAVAIL*1024))" ]; then
TO (LINE 1192):
if [ "$SIZEDB" -gt "$SIZEAVAIL" ]; then
I have tried to create a dummy script to simulate this scenario (See attachment)
[email protected]:/tmp/home/root# bash test.sh SCRIPT_STORAGE_DIR: /opt/share/connmon.d SIZEAVAIL: 7256944 SIZEDB: 212992 Original Code: Database size exceeds available space. 208.0KB is required to create backup. Modified Code: Sufficient free space to back up database, proceeding...
Maybe this could help you resolve the issue and release a patch.
Note: It would be a good thing to add an option where a user will be asked if he wants to back up the previous database and also to check on the lock files before performing any deletion to the database files.
By the way. This is a great tool for monitoring your connection. Really appreciate this one. Cheers!