Two users need to write to the same folder without stepping on

Back to list2026-03-14
You

Two users need to write to the same folder without stepping on each other.

ChatGPT

A shared group plus the setgid bit: chgrp team dir && chmod 2775 dir. New files inherit the group, which is the part plain chmod 775 misses and the reason it stops working on the second day.

You
sourdough-crumb.png
You

The script runs fine in my shell and does nothing from cron.

ChatGPT

Cron runs with a minimal environment and no profile. Use absolute paths, set PATH at the top of the crontab, and redirect output to a file so the failure has somewhere to appear. Nine times in ten the missing piece is one of those three.

You

rsync of a directory with 2M small files takes forever.

ChatGPT

The bottleneck is per-file syscalls, not bandwidth. tar piped over ssh moves them as a single stream and is often several times faster; rsync becomes the right tool again on the second run, when only the differences matter.

You

What would you skip entirely?

ChatGPT

The reporting layer, until something forces it. It is the part that feels productive to build and the part nobody opens twice.