From 4e4180fb5c2df8515b7c5c3baa7396a9dbb93ad9 Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 29 Dec 2019 22:48:13 +1000 Subject: Re archive the rest as well. --- apt-panopticon-update-data.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apt-panopticon-update-data.lua b/apt-panopticon-update-data.lua index cf0d83b..8251c9d 100755 --- a/apt-panopticon-update-data.lua +++ b/apt-panopticon-update-data.lua @@ -139,5 +139,15 @@ for l in files:lines() do 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) end +local rslt = APT.exe( 'ls -dl results | cut -d " " -f 11'):Do().result:sub(2, -2) +local rslto = APT.exe( 'ls -dl results_old | cut -d " " -f 11'):Do().result:sub(2, -2) +local files = io.popen('ls -d1 results_*-*-*-*-* 2>/dev/null') +for l in files:lines() do + if (rslt ~= l) and (rslto ~= l) then + if -1 < APT.verbosity then io.stdout:write('\r' .. 'tar -c --xz ' .. l:sub(1, 24) .. ' -f ' .. l:sub(1, 18) .. '/' .. l .. '.tar.xz'); io.stdout:flush() end + 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) + end +end + if -1 < APT.verbosity then print('\nFinished updating data.') end -- cgit v1.1