aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon-update-data.lua
diff options
context:
space:
mode:
authoronefang2019-12-27 23:00:32 +1000
committeronefang2019-12-27 23:00:32 +1000
commit8b9fa689319ca86275ae54f59894fb3c45ffbde6 (patch)
tree70229edcefcb14b6c149c5b567ca94c181f50b04 /apt-panopticon-update-data.lua
parentUpdate the TIMEOUT hack for updated percentage to match the new precision. (diff)
downloadapt-panopticon-8b9fa689319ca86275ae54f59894fb3c45ffbde6.zip
apt-panopticon-8b9fa689319ca86275ae54f59894fb3c45ffbde6.tar.gz
apt-panopticon-8b9fa689319ca86275ae54f59894fb3c45ffbde6.tar.bz2
apt-panopticon-8b9fa689319ca86275ae54f59894fb3c45ffbde6.tar.xz
Update script now tucks the archives into daily folders.
Diffstat (limited to 'apt-panopticon-update-data.lua')
-rwxr-xr-xapt-panopticon-update-data.lua20
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
48if -1 < APT.verbosity then print('\nUpacking tarballs and cleaning them.') end 48if -1 < APT.verbosity then print('\nUpacking tarballs and cleaning them.') end
49local files = io.popen('ls -1 results_*.tar.xz') 49local files = io.popen('ls -1 results_*.tar.xz 2>/dev/null; ls -1 results_*/results_*.tar.xz 2>/dev/null')
50for l in files:lines() do 50for 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]]
98end 101end
99 102
100 103
104--[[
101if -1 < APT.verbosity then print('\nDeleting old RRD data.') end 105if -1 < APT.verbosity then print('\nDeleting old RRD data.') end
102os.execute('rm -fr rrd') 106os.execute('rm -fr rrd')
103if -1 < APT.verbosity then print('\nRecreating RRD data.') end 107if -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
129end 133end
130 134]]
131 135
132os.execute('rm ' .. lock) 136os.execute('rm ' .. lock)
133 137
134 138
135if -1 < APT.verbosity then print('\nRecreating tarballs.') end 139if -1 < APT.verbosity then print('\nRecreating tarballs.') end
136local files = io.popen('ls -1 results_*.tar.xz') 140
141local files = io.popen('ls -1 results_*/results_*.tar.xz 2>/dev/null')
142for 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))
145end
146local files = io.popen('ls -1 results_*.tar.xz 2>/dev/null')
137for l in files:lines() do 147for 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)
140end 150end
141 151
142 152