[ Date Index ]
[ Thread Index ]
[ <= Previous by date /
thread ]
[ Next by date /
thread => ]
[LUG]Re: writing shell scripts
- To: list@xxxxxxxxxxxxx
- Subject: [LUG]Re: writing shell scripts
- From: Peter Walker via list <list@xxxxxxxxxxxxx>
- Date: Fri, 24 Oct 2025 17:39:54 +0100
- Cc: Peter Walker <peter.walker@xxxxxxxxxxxxxxx>
- Delivered-to: dclug@xxxxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dcglug.org.uk; s=1760519162; h=Content-Type:Cc:From:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Help:List-Id:Subject:Reply-To: MIME-Version:Message-ID:References:In-Reply-To:To:Date:Sender: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Archive; bh=Fk5EV3GAD/SQ0DEWdudPGhvnAvSO0X9EED5uC1FwZR8=; b=TeZ3+e5isYZLL7YJUhTJP9stQu Xl1Ez4O4dDaA6zdUJYz1kspEhd2ZL2znXMIKQ7i6MCnS8COUatsHIdKf1xgaURelHKjzLvIw7Jpvk BB5faVCMLNctkj70kSXvwndC0LVo5PAFdD8Ohyj/vRAa2jLMtTLXqRnphvb88Oxaqg0Y=;
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/