From 0ea4c99102bbd3aecc11c164395ece5a8edd5dc8 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 5 May 2021 15:32:53 -0400 Subject: [PATCH] remove support for months as it isnt supported in InfluxQL --- salt/common/tools/sbin/so-influxdb-clean | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/salt/common/tools/sbin/so-influxdb-clean b/salt/common/tools/sbin/so-influxdb-clean index 453d5b2e4..954abfa8f 100644 --- a/salt/common/tools/sbin/so-influxdb-clean +++ b/salt/common/tools/sbin/so-influxdb-clean @@ -15,15 +15,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -modurregex="^[0-9]+mo$" wdurregex="^[0-9]+w$" ddurregex="^[0-9]+d$" echo -e "\nThis script is used to reduce the size of InfluxDB by removing old data and retaining only the duration specified." echo "The duration will need to be specified as an integer followed by the duration unit, without a space." -echo -e "\nFor example, to purge all data, but retain the past 3 months, specify 3mo for the duration." +echo -e "\nFor example, to purge all data, but retain the past 12 weeks, specify 12w for the duration." echo "The duration units are as follows:" -echo " mo - month(s)" echo " w - week(s)" echo " d - day(s)" @@ -32,7 +30,7 @@ while true; do read -p 'Enter the duration of past data that you would like to retain: ' duration duration=$(echo $duration | tr '[:upper:]' '[:lower:]') - if [[ "$duration" =~ $modurregex ]] || [[ "$duration" =~ $wdurregex ]] || [[ "$duration" =~ $ddurregex ]]; then + if [[ "$duration" =~ $wdurregex ]] || [[ "$duration" =~ $ddurregex ]]; then break fi