The Incident: Two Bots Opened the Same File
The bot on the Windows device and the bot on the Mac mini edited 「today's to-do.md」 in the shared folder at almost the same moment. Whoever saved last overwrote everything the other had written, and half of the morning's notes disappeared. We recovered them from the sync history, but the cause was simple: neither bot knew the other was writing to the file.
The Fix: One 「In Use」 Sign
No coding knowledge is needed. You just place a small file next to the real one to act as a sign.
1. Create a lock folder inside the shared folder.
2. Give your bot instructions like these.
Before editing a file, check whether 「filename.lock」 exists in the lock folder.
If it exists, do not edit. Check again after 5 minutes.
If it does not exist, create the lock file, and delete it when you finish.
Write your name and the time inside the lock file.
3. Treat any lock older than 30 minutes as a 「dead sign」 and have the bot ask Bella before deleting it. If a bot stops halfway, its sign stays behind.
After Using It
• Overwrite accidents have not happened again since we started.
• A 「waiting」 message appears now and then, but checking the log is enough.
• With a name and time written inside, you can see at a glance who is holding the file.
Today's Tip
A visible sign beats a perfect system. If several bots share a file, start by creating a lock folder today.