Score:0

How to run a cronjob every 3 minutes and 2 seconds (every 182 seconds)

gq flag

I have a script that I want to run every 182 seconds. As you know, cronjob precision is minutes so first I want to ask how can I run my code as a job every 182 seconds?

Secondly, I want to ask is there any better and efficient solution as cronjob is, to run a command periodically with a better precision than cronjob? I heard about some alternative options like watch command. However, I want a comparison between these options and cronjob and possible advantages or disadvantages each one has.

ec flag
Welcome to the Ask Ubuntu community. As your question doesn't appear to be related to the Ubuntu OS specifically, I'd suggest that you ask this question over on the Unix/Linux site instead (here's something I found that might help answer your question: https://unix.stackexchange.com/q/602792/60677). But in short, unless you're using a real-time OS (which the standard Ubuntu is not), the precision your looking for will be difficult to guarantee with any level of consistency (your best bet will be +/- a few seconds).
hr flag
Related: [crontab run every x hours vs run when modulo hour is zero](https://askubuntu.com/questions/1449927/crontab-run-every-x-hours-vs-run-when-modulo-hour-is-zero)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.