diff options
author | onefang | 2019-12-29 17:29:14 +1000 |
---|---|---|
committer | onefang | 2019-12-29 17:29:14 +1000 |
commit | 78374d457ca0562ba36f72997e3bdd95dfa26b91 (patch) | |
tree | bf98080c1a39d83cb3e8bcfbf558af166a3c93e0 | |
parent | Fix up some time stuff. (diff) | |
download | apt-panopticon-78374d457ca0562ba36f72997e3bdd95dfa26b91.zip apt-panopticon-78374d457ca0562ba36f72997e3bdd95dfa26b91.tar.gz apt-panopticon-78374d457ca0562ba36f72997e3bdd95dfa26b91.tar.bz2 apt-panopticon-78374d457ca0562ba36f72997e3bdd95dfa26b91.tar.xz |
Oops, forgot to actually Do() these time calcs.
Diffstat (limited to '')
-rwxr-xr-x | apt-panopticon.lua | 6 |
1 files 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. | |||
1069 | 1069 | ||
1070 | APT.logPost() | 1070 | APT.logPost() |
1071 | else | 1071 | else |
1072 | local fadt = io.popen("ls -dl results_old 2>/dev/null | cut -d '>' -f 2 | cut -d ' ' -f 2") | 1072 | local adt = APT.exe("ls -dl results_old 2>/dev/null | cut -d '>' -f 2 | cut -d ' ' -f 2"):Do().result:sub(2, -2) |
1073 | local adt = fadt:read('*l') | ||
1074 | fadt:close() | ||
1075 | if (nil ~= adt) and APT.checkFile(adt) then | 1073 | if (nil ~= adt) and APT.checkFile(adt) then |
1076 | APT.exe('mkdir -p ' .. adt:sub(1, 18)) | 1074 | APT.exe('mkdir -p ' .. adt:sub(1, 18)) |
1077 | :And():Nice('tar -c --xz ' .. adt .. ' -f ' .. adt:sub(1, 18) .. '/' .. adt .. '.tar.xz') | 1075 | :And():Nice('tar -c --xz ' .. adt .. ' -f ' .. adt:sub(1, 18) .. '/' .. adt .. '.tar.xz') |
1078 | :And('rm -fr ' .. adt):noErr():fork() | 1076 | :And('rm -fr ' .. adt):noErr():fork() |
1079 | end | 1077 | end |
1080 | local dt = os.date('!%F-%H-%M') | 1078 | local dt = os.date('!%F-%H-%M') |
1081 | local odt = APT.exe('TZ="GMT" date -r results/stamp +%F-%H-%M 2>/dev/null', 'r').result:sub(2, -2) | 1079 | local odt = APT.exe('TZ="GMT" date -r results/stamp +%F-%H-%M 2>/dev/null'):Do().result:sub(2, -2) |
1082 | if nil ~= odt then os.execute(' rm -f results_old; ln -s results_' .. odt .. ' results_old 2>/dev/null') end | 1080 | if nil ~= odt then os.execute(' rm -f results_old; ln -s results_' .. odt .. ' results_old 2>/dev/null') end |
1083 | if nil ~= dt then os.execute('mkdir -p results_' .. dt .. '; rm -f results; ln -s results_' .. dt .. ' results 2>/dev/null') end | 1081 | if nil ~= dt then os.execute('mkdir -p results_' .. dt .. '; rm -f results; ln -s results_' .. dt .. ' results 2>/dev/null') end |
1084 | os.execute('if [ -f results/stamp ]; then mv results/stamp results/stamp.old; else touch results/stamp.old -t 199901010000; fi; touch results/stamp') | 1082 | os.execute('if [ -f results/stamp ]; then mv results/stamp results/stamp.old; else touch results/stamp.old -t 199901010000; fi; touch results/stamp') |