From 78374d457ca0562ba36f72997e3bdd95dfa26b91 Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 29 Dec 2019 17:29:14 +1000 Subject: Oops, forgot to actually Do() these time calcs. --- apt-panopticon.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 7ef300c..56eb848 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -1069,16 +1069,14 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. APT.logPost() else - local fadt = io.popen("ls -dl results_old 2>/dev/null | cut -d '>' -f 2 | cut -d ' ' -f 2") - local adt = fadt:read('*l') - fadt:close() + local adt = APT.exe("ls -dl results_old 2>/dev/null | cut -d '>' -f 2 | cut -d ' ' -f 2"):Do().result:sub(2, -2) if (nil ~= adt) and APT.checkFile(adt) then APT.exe('mkdir -p ' .. adt:sub(1, 18)) :And():Nice('tar -c --xz ' .. adt .. ' -f ' .. adt:sub(1, 18) .. '/' .. adt .. '.tar.xz') :And('rm -fr ' .. adt):noErr():fork() end local dt = os.date('!%F-%H-%M') - local odt = APT.exe('TZ="GMT" date -r results/stamp +%F-%H-%M 2>/dev/null', 'r').result:sub(2, -2) + local odt = APT.exe('TZ="GMT" date -r results/stamp +%F-%H-%M 2>/dev/null'):Do().result:sub(2, -2) if nil ~= odt then os.execute(' rm -f results_old; ln -s results_' .. odt .. ' results_old 2>/dev/null') end if nil ~= dt then os.execute('mkdir -p results_' .. dt .. '; rm -f results; ln -s results_' .. dt .. ' results 2>/dev/null') end os.execute('if [ -f results/stamp ]; then mv results/stamp results/stamp.old; else touch results/stamp.old -t 199901010000; fi; touch results/stamp') -- cgit v1.1