aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-12-05 03:10:45 +1000
committeronefang2019-12-05 03:10:45 +1000
commit78fef0f95d89d6e349ae3328555e2b0b043db756 (patch)
tree8fdc577ee14e97f77285b6a75266676ecc924b4d
parentCheck for existance of Release file before trying to sort it. (diff)
downloadapt-panopticon-78fef0f95d89d6e349ae3328555e2b0b043db756.zip
apt-panopticon-78fef0f95d89d6e349ae3328555e2b0b043db756.tar.gz
apt-panopticon-78fef0f95d89d6e349ae3328555e2b0b043db756.tar.bz2
apt-panopticon-78fef0f95d89d6e349ae3328555e2b0b043db756.tar.xz
Pack up ancient results for later.
Diffstat (limited to '')
-rwxr-xr-xapt-panopticon.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index 430aa87..3afe3a1 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -1098,9 +1098,13 @@ if 0 < #arg then
1098 logPost() 1098 logPost()
1099 logFile:close() 1099 logFile:close()
1100else 1100else
1101 local fadt = io.popen("ls -dl results_old 2>/dev/null | cut -d '>' -f 2 | cut -d ' ' -f 2")
1102 local adt = fadt:read('*l')
1103 fadt:close()
1104 if 0 ~= #adt then os.execute('tar -c --xz ' .. adt .. ' -f ' .. adt .. '.tar.xz') end
1101 local dt = os.date('!%Y-%m-%d-%H-%M') 1105 local dt = os.date('!%Y-%m-%d-%H-%M')
1102 local fodt = io.popen('TZ="GMT" date -r results/stamp +%Y-%m-%d-%H-%M', 'r') 1106 local fodt = io.popen('TZ="GMT" date -r results/stamp +%Y-%m-%d-%H-%M', 'r')
1103 odt = fodt:read('*l') 1107 local odt = fodt:read('*l')
1104 fodt:close() 1108 fodt:close()
1105 os.execute(' rm -f results_old; ln -s results_' .. odt .. ' results_old 2>/dev/null') 1109 os.execute(' rm -f results_old; ln -s results_' .. odt .. ' results_old 2>/dev/null')
1106 os.execute('mkdir -p results_' .. dt .. '; rm -f results; ln -s results_' .. dt .. ' results 2>/dev/null') 1110 os.execute('mkdir -p results_' .. dt .. '; rm -f results; ln -s results_' .. dt .. ' results 2>/dev/null')
@@ -1156,6 +1160,8 @@ else
1156 end 1160 end
1157 end 1161 end
1158 1162
1163 if 0 ~= #adt then os.execute('rm -fr ' .. adt .. ' 2>/dev/null') end
1164
1159 logPost() 1165 logPost()
1160 logFile:close() 1166 logFile:close()
1161end 1167end