Из ленты dev.to devops — кратко, чтобы не потерять.
The backup ran every night at 2am and emailed me a green “847 files archived” summary. I’d built it, tested it against my own home directory where every file was named like report_2024.csv , watched it sail through, and shipped it. For weeks the summary said everything was fine. Then a coworker asked me to restore a file. Q3 forecast.xlsx . It wasn’t in the archive. Neither was Annual Review FINAL.pdf , or meeting notes (draft).md , or any of the other 23 files someone had named the way normal humans name files — with spaces in them. The backup had been quietly skipping the most important files on the share for a week, and the nightly email had been telling me the whole time that nothing was wrong. Here’s the line that did it: for file in $( ls " $DIR " ) ; do echo “Processing $file " done
Полный текст и контекст у первоисточника: https://dev.to/bashsnippets/a-for-loop-skipped-23-files-and-called-it-a-successful-backup-2j3f