Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

66%
+2 −0
Q&A Run a command *later*

How can I run a command later? I'm looking for a CLI way to schedule a command to be run later. I know that I could create a systemd timer, install it, activate it... That is too much work. I want...

2 answers  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by Canina‭

Question cli scheduling
#1: Initial revision by user avatar matthewsnyder‭ · 2023-08-22T23:16:32Z (about 1 year ago)
Run a command *later*
How can I run a command *later*? I'm looking for a CLI way to schedule a command to be run later.

I know that I could create a systemd timer, install it, activate it... That is too much work. I want something like `runlater 10min some_cmd` and `some_cmd` runs 10 min later.

I don't want to do `sleep 600 && some_cmd` because that will block. After I schedule the program to run later, I want to go back to my shell, do some other stuff, close the terminal, and the command should still execute when it's time.

If I schedule a program for 10 mins later and shut down the computer 8 mins later, I don't really care what happens. The program can end up being not run. A notification about it the next time I boot up would be nice, but otherwise I'm thinking of situation where the uptime will not be interrupted.