On Wed, Aug 21, 2024 at 08:39:37 +0200, Erwan David wrote: > On Wed, Aug 21, 2024 at 02:18:44AM CEST, Greg Wooledge <g...@wooledge.org> > said: > > On Tue, Aug 20, 2024 at 20:04:11 -0400, Roberto C. Sánchez wrote: > > > sync && sync && sync && swapoff > > > > > > I couldn't tell why I have sync 3 times, but I know that it's how I've > > > called swapoff since as far back as I can remember. > > > > Cargo cult. It was never useful to the best of my knowledge. > > Once upon a time, the sync command would return before the actual > syscall where completed. Doing 3 times sync gave you a very high > probability that the first one indeed completed all its writes. > > But it was already false in SunOS 4 (~1990)
Even if that's true, running them all in the same command as Roberto shows would not give you any benefit. You'd need to physically *type* the command and press Enter three times to get any "protection". And even then, it's really just the extra time that it takes to type those commands out. You'd get the same "protection" by simply waiting 10 seconds (or whatever's appropriate) after running sync once.