diff options
author | onefang | 2019-12-11 04:25:58 +1000 |
---|---|---|
committer | onefang | 2019-12-11 04:25:58 +1000 |
commit | d54e4b23893d24bc2cbaf14018e3f61517c4a482 (patch) | |
tree | 3b3d4fa401d608a1c8b7261bf7e912e440cc9d1a /apt-panopticon-RRD-rescue.lua | |
parent | Detect timeouts for actually downloaded files as well. (diff) | |
download | apt-panopticon-d54e4b23893d24bc2cbaf14018e3f61517c4a482.zip apt-panopticon-d54e4b23893d24bc2cbaf14018e3f61517c4a482.tar.gz apt-panopticon-d54e4b23893d24bc2cbaf14018e3f61517c4a482.tar.bz2 apt-panopticon-d54e4b23893d24bc2cbaf14018e3f61517c4a482.tar.xz |
Rename RRD-rescue to update-data.
Diffstat (limited to 'apt-panopticon-RRD-rescue.lua')
-rwxr-xr-x | apt-panopticon-RRD-rescue.lua | 46 |
1 files changed, 0 insertions, 46 deletions
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 @@ | |||
1 | #!/usr/bin/env luajit | ||
2 | |||
3 | local APT = require 'apt-panopticommon' | ||
4 | local D = APT.D | ||
5 | local I = APT.I | ||
6 | local W = APT.W | ||
7 | local C = APT.C | ||
8 | local arg, sendArgs = APT.parseArgs({...}) | ||
9 | |||
10 | |||
11 | os.execute('rm -fr rrd') | ||
12 | |||
13 | local files = io.popen('ls -1 results_*.tar.xz') | ||
14 | for l in files:lines() do | ||
15 | print('tar -xf ' .. l) | ||
16 | os.execute('tar -xf ' .. l) | ||
17 | end | ||
18 | |||
19 | local files = io.popen('ls -d1 results_*') | ||
20 | for 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 | ||
40 | end | ||
41 | |||
42 | local files = io.popen('ls -1 results_*.tar.xz') | ||
43 | for l in files:lines() do | ||
44 | print('rm -rf ' .. l:sub(1, 24)) | ||
45 | os.execute('rm -rf ' .. l:sub(1, 24)) | ||
46 | end | ||