diff options
Diffstat (limited to '')
-rwxr-xr-x | apt-panopticon-update-data.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/apt-panopticon-update-data.lua b/apt-panopticon-update-data.lua index ceef7f3..82509ad 100755 --- a/apt-panopticon-update-data.lua +++ b/apt-panopticon-update-data.lua | |||
@@ -46,7 +46,7 @@ os.execute('touch ' .. lock) | |||
46 | 46 | ||
47 | 47 | ||
48 | if -1 < APT.verbosity then print('\nUpacking tarballs and cleaning them.') end | 48 | if -1 < APT.verbosity then print('\nUpacking tarballs and cleaning them.') end |
49 | local files = io.popen('ls -1 results_*.tar.xz') | 49 | local files = io.popen('ls -1 results_*.tar.xz 2>/dev/null; ls -1 results_*/results_*.tar.xz 2>/dev/null') |
50 | for l in files:lines() do | 50 | for l in files:lines() do |
51 | local lsub = l:sub(1, -8) | 51 | local lsub = l:sub(1, -8) |
52 | if 0 == oldest then | 52 | if 0 == oldest then |
@@ -58,6 +58,8 @@ for l in files:lines() do | |||
58 | end | 58 | end |
59 | if -1 < APT.verbosity then io.stdout:write('\r' .. 'tar -xf ' .. l); io.stdout:flush() end | 59 | if -1 < APT.verbosity then io.stdout:write('\r' .. 'tar -xf ' .. l); io.stdout:flush() end |
60 | os.execute('tar -xf ' .. l) | 60 | os.execute('tar -xf ' .. l) |
61 | |||
62 | --[[ | ||
61 | os.execute('rm -f ' .. lsub .. '/*.curl') | 63 | os.execute('rm -f ' .. lsub .. '/*.curl') |
62 | os.execute('rm -f ' .. lsub .. '/STATUS_*') | 64 | os.execute('rm -f ' .. lsub .. '/STATUS_*') |
63 | 65 | ||
@@ -95,9 +97,11 @@ for l in files:lines() do | |||
95 | for k in fls:lines() do | 97 | for k in fls:lines() do |
96 | fixResults(k) | 98 | fixResults(k) |
97 | end | 99 | end |
100 | ]] | ||
98 | end | 101 | end |
99 | 102 | ||
100 | 103 | ||
104 | --[[ | ||
101 | if -1 < APT.verbosity then print('\nDeleting old RRD data.') end | 105 | if -1 < APT.verbosity then print('\nDeleting old RRD data.') end |
102 | os.execute('rm -fr rrd') | 106 | os.execute('rm -fr rrd') |
103 | if -1 < APT.verbosity then print('\nRecreating RRD data.') end | 107 | if -1 < APT.verbosity then print('\nRecreating RRD data.') end |
@@ -127,16 +131,22 @@ for l in files:lines() do | |||
127 | end | 131 | end |
128 | end | 132 | end |
129 | end | 133 | end |
130 | 134 | ]] | |
131 | 135 | ||
132 | os.execute('rm ' .. lock) | 136 | os.execute('rm ' .. lock) |
133 | 137 | ||
134 | 138 | ||
135 | if -1 < APT.verbosity then print('\nRecreating tarballs.') end | 139 | if -1 < APT.verbosity then print('\nRecreating tarballs.') end |
136 | local files = io.popen('ls -1 results_*.tar.xz') | 140 | |
141 | local files = io.popen('ls -1 results_*/results_*.tar.xz 2>/dev/null') | ||
142 | for l in files:lines() do | ||
143 | if -1 < APT.verbosity then io.stdout:write('\r' .. 'tar -c --xz ' .. l:sub(20, 43) .. ' -f ' .. l); io.stdout:flush() end | ||
144 | os.execute('mkdir -p ' .. l:sub(1, 18) .. '; tar -c --xz ' .. l:sub(20, 43) .. ' -f ' .. l .. '; rm -fr ' .. l:sub(20, 43)) | ||
145 | end | ||
146 | local files = io.popen('ls -1 results_*.tar.xz 2>/dev/null') | ||
137 | for l in files:lines() do | 147 | for l in files:lines() do |
138 | if -1 < APT.verbosity then io.stdout:write('\r' .. 'tar -c --xz ' .. l:sub(1, 24) .. ' -f ' .. l .. '; rm -fr ' .. l:sub(1, 24)); io.stdout:flush() end | 148 | if -1 < APT.verbosity then io.stdout:write('\r' .. 'tar -c --xz ' .. l:sub(1, 24) .. ' -f ' .. l:sub(1, 18) .. '/' .. l); io.stdout:flush() end |
139 | os.execute('tar -c --xz ' .. l:sub(1, 24) .. ' -f ' .. l .. '; rm -fr ' .. l:sub(1, 24)) | 149 | os.execute('mkdir -p ' .. l:sub(1, 18) .. '; tar -c --xz ' .. l:sub(1, 24) .. ' -f ' .. l:sub(1, 18) .. '/' .. l .. '; rm -fr ' .. l:sub(1, 24) .. '; rm -f ' .. l) |
140 | end | 150 | end |
141 | 151 | ||
142 | 152 | ||