From d54e4b23893d24bc2cbaf14018e3f61517c4a482 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 11 Dec 2019 04:25:58 +1000 Subject: Rename RRD-rescue to update-data. --- apt-panopticon-RRD-rescue.lua | 46 ------------------------------------------ apt-panopticon-update-data.lua | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) delete mode 100755 apt-panopticon-RRD-rescue.lua create mode 100755 apt-panopticon-update-data.lua diff --git a/apt-panopticon-RRD-rescue.lua b/apt-panopticon-RRD-rescue.lua deleted file mode 100755 index 461ae39..0000000 --- a/apt-panopticon-RRD-rescue.lua +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env luajit - -local APT = require 'apt-panopticommon' -local D = APT.D -local I = APT.I -local W = APT.W -local C = APT.C -local arg, sendArgs = APT.parseArgs({...}) - - -os.execute('rm -fr rrd') - -local files = io.popen('ls -1 results_*.tar.xz') -for l in files:lines() do - print('tar -xf ' .. l) - os.execute('tar -xf ' .. l) -end - -local files = io.popen('ls -d1 results_*') -for l in files:lines() do - if ('results_old' ~= l) and ('.tar.xz' ~= l:sub(25, -1)) then - if APT.checkFile(l .. '/stamp') then - local status, whn = APT.execute('TZ="GMT" ls -d1 --time-style="+%s" ' .. l .. ' | cut -d " " -f 6-6') - whn = whn:sub(2, -2) - local status, new = APT.execute('TZ="GMT" date -d "' .. whn:sub(9, 18) .. ' ' .. whn:sub(20, 21) .. ':' .. whn:sub(23, 24) .. '" "+%s"') - APT.now = tonumber("0" .. new:sub(2, -2)) - if 0 ~= APT.now then - print(l .. ' -> ' .. APT.now) - APT.mirrors = loadfile(l .. "/mirrors.lua")() - for k, v in pairs(APT.mirrors) do - APT.doRRD(l, k, v) - end - else - print(l) - end - else - print(l) - end - end -end - -local files = io.popen('ls -1 results_*.tar.xz') -for l in files:lines() do - print('rm -rf ' .. l:sub(1, 24)) - os.execute('rm -rf ' .. l:sub(1, 24)) -end diff --git a/apt-panopticon-update-data.lua b/apt-panopticon-update-data.lua new file mode 100755 index 0000000..461ae39 --- /dev/null +++ b/apt-panopticon-update-data.lua @@ -0,0 +1,46 @@ +#!/usr/bin/env luajit + +local APT = require 'apt-panopticommon' +local D = APT.D +local I = APT.I +local W = APT.W +local C = APT.C +local arg, sendArgs = APT.parseArgs({...}) + + +os.execute('rm -fr rrd') + +local files = io.popen('ls -1 results_*.tar.xz') +for l in files:lines() do + print('tar -xf ' .. l) + os.execute('tar -xf ' .. l) +end + +local files = io.popen('ls -d1 results_*') +for l in files:lines() do + if ('results_old' ~= l) and ('.tar.xz' ~= l:sub(25, -1)) then + if APT.checkFile(l .. '/stamp') then + local status, whn = APT.execute('TZ="GMT" ls -d1 --time-style="+%s" ' .. l .. ' | cut -d " " -f 6-6') + whn = whn:sub(2, -2) + local status, new = APT.execute('TZ="GMT" date -d "' .. whn:sub(9, 18) .. ' ' .. whn:sub(20, 21) .. ':' .. whn:sub(23, 24) .. '" "+%s"') + APT.now = tonumber("0" .. new:sub(2, -2)) + if 0 ~= APT.now then + print(l .. ' -> ' .. APT.now) + APT.mirrors = loadfile(l .. "/mirrors.lua")() + for k, v in pairs(APT.mirrors) do + APT.doRRD(l, k, v) + end + else + print(l) + end + else + print(l) + end + end +end + +local files = io.popen('ls -1 results_*.tar.xz') +for l in files:lines() do + print('rm -rf ' .. l:sub(1, 24)) + os.execute('rm -rf ' .. l:sub(1, 24)) +end -- cgit v1.1