D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG]Re: writing shell scripts

 

Hi Paul,

Sounds like it should be pretty easy to do.
One option would be to put each day's toot in a file that has the date it should be sent on at the start of the filename (eg. 20251025-toot1). Your cron job would just use the date command to select the file for that day and toot that. Something like

toot post < $(date +%Y%m%d)-*

That should do the basic job. As with most shell scripts the hard work is making it handle errors and unexpected inputs.
It would probably also be sensible to move the procesed file to a sent directory to prevent multiple posts.

Cheers,
Pete
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-- 
The Mailing List for the Devon & Cornwall LUG
FAQ: https://www.dcglug.org.uk/faq/