aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xapt-panopticon-RRD-rescue.lua40
1 files changed, 40 insertions, 0 deletions
diff --git a/apt-panopticon-RRD-rescue.lua b/apt-panopticon-RRD-rescue.lua
new file mode 100755
index 0000000..8fd06c0
--- /dev/null
+++ b/apt-panopticon-RRD-rescue.lua
@@ -0,0 +1,40 @@
1#!/usr/bin/env luajit
2
3local APT = require 'apt-panopticommon'
4local D = APT.D
5local I = APT.I
6local W = APT.W
7local C = APT.C
8local arg, sendArgs = APT.parseArgs({...})
9
10
11os.execute('rm -fr rrd')
12
13local files = io.popen('ls -1 *.tar.xz')
14for l in files:lines() do
15-- print('tar -xf ' .. l)
16-- os.execute('tar -xf ' .. l)
17end
18
19local files = io.popen('ls -d1 results_*')
20for l in files:lines() do
21 if ('results_old' ~= l) and ('.tar.xz' ~= l:sub(25, -1)) then
22 if APT.checkFile(l .. '/stamp') then
23 local status, whn = APT.execute('TZ="GMT" ls -d1 --time-style="+%s" ' .. l .. ' | cut -d " " -f 6-6')
24 whn = whn:sub(2, -2)
25 local status, new = APT.execute('TZ="GMT" date -d "' .. whn:sub(9, 18) .. ' ' .. whn:sub(20, 21) .. ':' .. whn:sub(23, 24) .. '" "+%s"')
26 APT.now = tonumber("0" .. new:sub(2, -2))
27 if 0 ~= APT.now then
28 print(l .. ' -> ' .. APT.now)
29 APT.mirrors = loadfile(l .. "/mirrors.lua")()
30 for k, v in pairs(APT.mirrors) do
31 APT.doRRD(l, k, v)
32 end
33 else
34 print(l)
35 end
36 else
37 print(l)
38 end
39 end
40end