Hacker News new | ask | show | jobs
by andrewfong 3266 days ago
Let me programmatically schedule a task to run at a specific time, just once. E.g. if my user tells me to remind them about something in a day, I want to schedule a task to do that exactly 24 hours from now.

I'm sure this exists already but it's hard to find because searching usually points me to a cronjob service. But what I'm looking for is distinct from a that. I don't want to run something every minute or hour or checking if there's any work to do. I just want a given task to run as a pre-determined time, scaled to any arbitrary number of tasks.

6 comments

The cron alternative that does something only once is 'at'.
The modern at alternative is:

systemd-run --user --on-calendar=23:20 notify-send Example

Or relative with --on-active=60. And you automatically get the normal systemd tooling, e.g. systemctl list-timers.

well this works fine for a single host. but if you deal with a cluster or inside a cloud you better use kubernetes for that.
I am building a set of Nodejs ipy notebooks to do this kind of stuff: https://github.com/megamindbrian/jupytangular

Eventually I want to wrap it in an Angular interface.

What exactly do you mean by a "task". Just remind you by sending you an email? or actually running a command on your computer?
I think Zapier and other similar services can do this sort of thing?
Celery?
I've heard good things about Autohotkey, but every time I try to do even the simplest of tasks it becomes a hassle. Like even just clicking on a specific point on your screen you have to know the exact coordinates of the place you want clicked. It seems like it'd be very easy just to record where you want to click.
When I'm working on tasks like that I like to add a hotkey that just puts the mouse's location on a tooltip for me. Sometimes you can just Tab to whatever you're trying to click, too, which is robust to window position.