💾 Archived View for bbs.geminispace.org › s › Gemini › 11524 captured on 2023-12-28 at 16:04:58. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-11-14)
-=-=-=-=-=-=-
In case there are any Chromebook folk that enjoy Lua thereupon:
I wound up formatting gemlog post file names: YYYY-MM-DD-HH-MM-SS.gmi
Along the way, it hit me that being able to compare the date/time-stamp in the file name with that returned by:
ls -l --time-style full-iso
would allow detecting post files to be considered updated, and thus to be included as "put"'s in a batchfile passed to sftp's -b flag.
I'm not going to show the entire solution, as I know people prefer to roll their own. But perhaps these scripts I wrote as part of my solution might save you time in that direction:
#! /usr/bin/env lua if arg[1] then local ls = io.popen('ls -l --time-style full-iso ' .. arg[1]) local line = ls:read('*l') ls:close() local year_ls, month_ls, date_ls, hour_ls, minute_ls, second_ls, year, month, date, hour, minute, second = string.match(line, '^.-steve3m%s-steve3m%s-%d-%s-(%d-)%-(%d-)%-(%d-)%s-(%d-):(%d-):(%d-)%.%d-%s-%-%d-%s-(%d-)%-(%d-)%-(%d-)%-(%d-)%-(%d-)%-(%d-)%.gmi