NSPATCH(1p)

πŸ“¦
version 1.85 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

✨ NSPATCH(1p) ✨

so this is a page from the User Contributed Perl Documentation stack, and bestie it is lowkey a banger. it's giving cron-friendly, it's giving retry logic, it's giving no more mystery failures at 3am. let's get into it πŸ’…


🌸 NAME 🌸

nspatch β€” run `nsdiff | nsupdate` with error handling


πŸ¦‹ SYNOPSIS πŸ¦‹

nspatch [-hVv] [-r count]
        -- [nsdiff options] -- [nsupdate options]

πŸ’– DESCRIPTION πŸ’–

okay so nspatch runs `"nsdiff | nsupdate"` and β€” this is the whole point β€” makes sure both of those programs finished successfully. if everything went fine she says absolutely nothing, because she's built for cron and cron does not want the drama. it suppresses their output unless there's an error.

the nsupdate script that nsdiff produces comes with a prerequisite check built in, so if there's a concurrent update happening it will detect that and fail instead of doing something cursed πŸ™ˆ. nspatch notices those failures and just... retries the update. resilient queen behavior πŸ‘‘

and here's a fun little implementation detail: instead of using a pipe, nspatch uses temporary files to store the output of nsdiff and nsupdate. no pipe, no cap 🧚


✨ OPTIONS ✨

  • -h β€” displays this documentation. hi hello here's the lore πŸ“–
  • -V β€” displays version information. which version of this icon are we running πŸ’œ
  • -r count β€” if the update fails because of a concurrent update, nspatch will retry up to count times. the default retry count is 2. so she'll keep trying, but she's not gonna try forever, boundaries βœ‹
  • -v β€” turns on verbose mode, so the output from nsdiff and nsupdate gets printed even when they succeeded. (by default that output is suppressed, silence is golden πŸŽ€)

also, the verbose option gets passed on to nsdiff, and the way that works is specific so pay attention bestie:

  • if nspatch is not given the -v option, it passes the -v '' option to nsdiff
  • if nspatch is given the -v option, it passes the -v 'qr' option to nsdiff

🌈 EXIT STATUS 🌈

nspatch returns 0 if no change is required or if the update is successful. it returns 1 if there is an error.

zero is the slay. one is the "something went wrong, check your logs bestie" 😭


πŸ“ ENVIRONMENT πŸ“

  • TMPDIR β€” location for temporary files. (remember those temporary files from the description? yeah. this is where they live 🏠)

πŸ‘‘ VERSION πŸ‘‘

this is nspatch-1.85 <https://dotat.at/prog/nsdiff/>

written by Tony Finch <fanf2@cam.ac.uk> <dot@dotat.at> at Cambridge University Information Services.

you may do anything with this. it has no warranty. (fr fr, no warranty, go wild 🌈)

🫢 SEE ALSO 🫢


and that's the whole page babes πŸ’– this was perl v5.40.1, dated 2026-01-26, and it's genuinely iconic for a manual page. go retry some updates responsibly βœ¨πŸ’…

πŸ“¦ where this page comes from