When to automate a repetitive task:

NO-BRAINER: "This is obviously going to be faster to automate than to do it by hand _even once_. Let's automate it right now, and not do it by hand at all."

FORESIGHTED: "Doing it once by hand is faster than automating it, but I'm going to have to do it a lot of times, so it still saves time to automate it first."

NEED A RUN-UP: "I don't yet understand this task well enough to automate it, so I'll do it a few times by hand first to get the idea."

RAN OFF THE RUNWAY: "Great, now I've done this by hand a few times, I think I can automate it reliably! Oh, oops, turned out I only had one more case of it left to do."

TERRIFIED OF RUNNING OFF THE RUNWAY: "This is a one-off, so it would be a waste of time to automate it, I'll just do it manually."
[next day] "Oh, oops, I made a mistake and have to do it again. But it should be fine this time."
[a month later] "Even though I've had to redo it 25 times already, surely _this_ is the last time? So it would still be a waste of time to automate it."

@simontatham SEP field: This is a regular but infrequent task which we share in the team. It won't be my turn to do it again until December so I'll do it manually now and hope someone has automated it before then.

@cunobaros @simontatham Automating something also provides complete documentation - that benefit shouldn't be underestimated 🧐

Sometimes I write a bash script which does (semi-)automagically a job which needs to be done quite rarely. Thus I don't forget something important 😇

@rkbw @cunobaros @simontatham In some cases it goes for me like this:
1. I have to do something and have to find out how to do it.
2. Some time later, I have to do it again and have to find out how to do it again.
3. The third time I am annoyed I haven't written down how to do it before, so finally I write down a recipe how to do it. (1/2)

4. The nth time, I write shell command snippets into my documentation to copy and paste, maybe even with variables for the parameters.
5. The (n + m)th time I finally convert this to a shell script.

Now this may sound a bit stupid like "why haven't I written documentation / a script the first tine?", but there may be months or years between the times I have to do that. (2/2)
@rkbw @cunobaros @simontatham