hpcp
A simple script that can issue multiple cp -af commands simultaneously on a local system.
Optimized for use in HPC scenarios and featuring auto-tuning for files-per-process.
Includes an adaptive progress bar for copying tasks from multiCMD.
Tested on a Lustre filesystem with 1.5 PB capacity running on 180 HDDs. Compared to using tar, hpcp reduced the time for tarball/image release from over 8 hours to under 10 minutes.
Development status
Basic functionality (parallel copy) should be stable.
Imaging functionality (source/destination as .img files) includes differential patch images (-diff / -siff, see below). Imaging is only available on Linux—similar to tar, but uses disk images.
Block-image functionality is in beta. Only available on Linux. Possible use case: cloning a currently running OS without mounting / as read-only.
hpcp.bat available on github: simple old tk based GUI intended for basic windows functionality.
Upgrading to 9.94 from 9.93
Nothing needs doing to upgrade, unless a script or a habit relies on what changed for it: at a terminal, text typed at one of hpcp's countdown prompts without Enter is no answer now, so the prompt's default applies; for -dd's All data on DEST will be lost that default is y (the multiCMD bullet). What changed:
-cogives a new file its owner, mode and xattrs through a descriptor wherecpmade it by name: what is at that name must be a file of the source's kind with one name, the runner's or already the old file's owner's, or the old copy is kept (190,it was replaced since cp made it). Without /proc (and on the BSDs; on macOS only wherecpfails hpcp's held-file question) 9.93 set them by name, so a link another user put at that name passed them to the file it led to (in a root run, its owner and its whole mode); with /proc and acpother than GNUcp, 9.93 refused a link and now also refuses a FIFO or another user's file there. A device node or socket source without /proc is still carried by name (planned for 9.95).- A
-corewrite's FAT attribute bits no longer go by path where there is no /proc: a-corewrite on a vfat reads and sets them relative to the directory hpcp holds. - No false "may be a mounted dir" hint: where a destination given more than one source is a file (
hpcp y z -d f, orhpcp a/x ldir/ -d a/xwithldira link toa), hpcp no longer printsDestination path ... may be a mounted dirandContinuing without creating dest folder...; what comes after names the problem, with the same exit code as before. - An early Ctrl-C on Python 3.9 to 3.11 with the forkserver or spawn start method prints no pool thread traceback: there a pool starts its workers as work comes, and when the stop ended a worker meanwhile, Python's pool thread could print
RuntimeError: dictionary changed size during iteration(EL7 with Python 3.11 and spawn: in 8 of 12 batches of ten early stops; macOS's default start method is spawn). The run still ended 130 with nothing lost; 3.12 and later never printed it. -ndswith-ncdsays a destination it refused:hpcp src/ -d A/ -d B/ -ncd -ndswithB/suba link printsNote: B/sub is a link to ... and -ncd makes no directory in its place; nothing is written below it (...), once a process for each such directory (9.89 to 9.93 said nothing). The exit code is as before. With a directory sync its own 213 line says it.-tfschecks every destination, before making it, on macOS too: a destination of another type is left out (Destination fs type mismatch, exit 227) and the run stops when none is left. A missing destination named with a trailing/is judged by its nearest existing parent before hpcp makes it (9.93 made it and copied, exit 0); one whose type cannot be read is left out too, naming why (9.93 skipped the check); and macOS reads the type withstatfs(apfs,msdos,exfat,smbfs, ...), where itsdfprinted none and 9.93 checked nothing.- The embedded multiCMD is 1.67 (1.64 before), used unless one at least as new is installed. At a terminal, text typed at a countdown prompt without Enter when the countdown runs out is no answer, so the prompt's default applies (at
-dd'sAll data on DEST will be lostthat is y: end annwith Enter). The-rmand-rmeprompts have no countdown. Sizes given to-L,-F,-disand-ddrare counted in exact whole bytes (4.1Gis 4,100,000,000; 9.93: 4,099,999,999). - A first Ctrl-C, SIGTERM or SIGHUP during the cleanup after an image run lets it finish: the unmounts, the delayed
e2fsckandtune2fs, and the loop detaches all run, and then the run ends as the signal asked (130 for Ctrl-C), after oneStopping: cleaning up firstline. 9.93 cut the step the stop landed in and skipped the rest, so mounts and loop devices could stay, and a-ddclone could keep the UUIDmkfsgave it. A later stop is ignored there as before; Ctrl-\ still ends hpcp at once. - Planned for 9.95 (see docs/limitations.md): the deferred entries 9.94 did not reach: the macOS copy check on network mounts, the
-siffapply relative to what it holds, a move's directory fsyncs in the pool, a leaner macOS binding of the xattr and ACL calls, the rest of the Linux-without-/proc entry, the read route in a directory the runner may not read, the macOS test suite, and four small ones (a-corewrite of a read-only source onto a file with auser.*xattr, themay be a mounted dirhint with one source, a stop between a run's last step and its cleanup, and whether a macOS-corewrite beside carries the old file's xattrs and ACL). - Known (see docs/limitations.md): on the BSDs and Linux without /proc (on macOS only where
cpfails hpcp's held-file question), a non-root-corewrite that goes beside, of a source whose new file its owner may not read (mode 0044), keeps the old copy (exit 190,Permission denied), where 9.93 completed it: give the source owner read; under-wb, a rerun without it completes a file the default writes in place.
Upgrading to 9.93 from 9.92
Nothing needs doing to upgrade, unless a script relies on what changed for it: on macOS, and on Linux with uutils' cp, a -co rewrite by a file's owner no longer keeps its set-user-ID or set-group-ID bit, and two 213 texts changed (the first bullet). What changed:
- The name probe can no longer remove a file: to ask a destination whether two names that fold alike (
Makefile,makefile) are one name there, hpcp now makes each as an empty directory in its hidden.hpcp-case-probe-...directory and removes them only withrmdir, which removes no file and nothing that holds anything, whatever another user puts at those names (the 213 linethe directory made to ask it was replaced by anotheris gone, andlet files be made therereadslet directories be made there). 9.83 to 9.92 made files and unlinked what they found, so on Windows, where the probe goes by path, a link put at its name could have it delete the files of the directory the link led to; 9.93 cannot. -cokeeps no set-ID bit a write would clear, on macOS too: a-corewrite by the file's owner (not root) ends with the file's mode less the set-ID bits the kernel clears on a write by that user, as a plain write leaves them. On macOS 9.90 to 9.92 kept them in place (4700 and 6755 stayed): macOS'scpputs back the mode it found once its own writes have cleared them; and a-wbrewrite there kept set-group-ID without group execute (2745), which macOS runs as a set-group-ID program and its own write clears. Linux with GNU cp is unchanged; uutils' cp puts the mode back as macOS's does, so 9.92 kept them there too.- Planned for 9.94 (done in 9.94: see above): first, a
-corewrite that goes beside, on Linux without /proc or on a BSD, sets the old file's mode, and in a root run its owner, by the new file's temporary name, so a link another user puts at that name passes them to the file it leads to (as in 9.92): 9.94 sets them through a descriptor of the new file, and a link there gets nothing; then the other deferred entries (9.94 did six of them and part of one more; one became a known limitation, and the rest are planned for 9.95). - Known (see docs/limitations.md): another user who may write the directory asked (not sticky, or owned by that user, or on macOS one whose inheritable ACL lets them write what is made in it), or a directory on the way to it, can decide the name probe's answer, as in 9.83 to 9.90 (9.91 and 9.92 refused most of these cases); the probe removes no file of theirs. A
kill -9while it asks (on Windows also a Ctrl-C) can leave hidden.hpcp-case-probe-...directories holding nothing but empty directories.
Upgrading to 9.92 from 9.91
Nothing needs doing to upgrade, unless a script relies on what changed for it: a -L, -F or -dis text that holds a digit but is no size hpcp reads (5foo, 1,5M), and a -ddr that is not a size above 0, now end the run with 241; -L .5G, -L +5G and a size with blanks around it (-L ' 10M'), which ran with no limit or no split, are read now; a value with no number gets a note on stderr; and the cleanup no longer shows what a command that ended 0 printed. What changed:
- The cleanup after an image run runs every step, quiet: its commands (
umount, the delayede2fsckandtune2fs,losetup) run without showing their output, and a step that fails no longer skips the steps after it. The delayed commands are named before they run; one that fails is still said on stderr, with the last lines of its stderr, and what a command that did not end 0 printed on stdout is shown once it has ended (ane2fsckthat repaired something ends 1: its report is shown). With multiCMD 1.64 installed beside hpcp 9.89 to 9.91,hpcp -dd src dst | headcould cut ane2fsckthat printed for over a second, and leave the loop devices attached. - The embedded multiCMD is 1.64 (1.61 before): an installed multiCMD is used when it is 1.64 or later (9.89 to 9.91 used 1.61 or later). A library call
hpcp.hpcp()on Python 3.6 with an ASCII stdout (LC_ALL=C) no longer ends 70 in the progress bar (multiCMD 1.62). - A size hpcp cannot read is refused (241) before anything is touched:
-ddr,-L,-Fand-distake a number with an optional unit (512,10M,1.5GiB: K to Y are 1000s, with ani1024s, and aBmay follow; a leading+and a point at either end are read;-Land-Fmay end in/sor/sec), below 1000Y, whether or not the run uses the option. A text with a digit that is no such size (5foo,1e3,1,5M,{10TiB}) is refused, and-ddrtakes nothing but a size above 0. Before,-ddr onewent on to wipe the destination's partition table,-L 5fooended in aTypeError,-L 1,5Mset the limit to 1 byte a second, and-L .5Gand-L ' 10M'ran with no limit (they are 0.5 GB and 10 MB a second now). -L,-Fand-diswith no number still mean no limit and no split, and now say so: a text with no digit (an empty one, as from an unset shell variable, a word), a negative number (-1) and a size below 1 (-F 0.5) run as before, with a line on stderr (Note: -L 'none' has no number: no rate limit).0is the way to write it, and says nothing.- Planned for 9.93 (done in 9.93: see above): the name probe's redesign and the cause of
-cokeeping a set-user-ID bit on macOS; the other deferred entries come after it. - Known (see docs/limitations.md): on EL7 (hard open-files limit 4,096) the levels of a destination tree deeper than 2,048, and a process out of descriptors, are walked by path, as 9.87 did (a symbolic link made with no free descriptor at all is not made:
Failed to create symbolic link: All destinations failed, skipping...; a rerun makes it); a directory hpcp opened to its owner keeps owner rwx where no finish sets its mode (-co,-nds, a named destination no source directory lands on), and on macOS one with no owner read can be left 0700; on macOS a case-only rename by a move (hpcp X -d x -rf) is refused with 241 on a case-insensitive APFS,hpcp a/x ldir/ -d a/xexits 202 where Linux exits 213, a hard link put at the name of a 0044 file between a move's look and its chmod can get the mode 0044, and a socket the operator names is not copied; on Python 3.6 and 3.7 an early Ctrl-C with forkserver or spawn can still print a worker'sEOFError.
Upgrading to 9.91 from 9.90
Nothing needs doing to upgrade. What changed:
- The name probe no longer empties, follows or waits for what another user puts at its name: a copy with two names that fold alike (
Makefile,makefile) asks the destination by making a hidden.hpcp-case-probe-...directory in it, and from 9.83 to 9.90 another local user who could write that destination could have it delete the files of another directory (in a root run, anyone's), stop the run for good with a FIFO, or have a file's times set. The probe now works through descriptors of the directories it holds, and a pair it cannot ask about in that run is refused (213) unless the destination's listing already holds both names; Windows still asks by path, and so does macOS in a directory the runner may write and search but not read, under a Python withoutos.O_SEARCHor where that open fails (9.93's probe removes no file there either: see above).
Upgrading to 9.90 from 9.89
Nothing needs doing to upgrade. What changed:
- A serial run draws its progress bar at most ten times a second:
-s, and the directory sync's serial pass, drew a frame after every file; a serial rerun with nothing to copy now costs about a third fewer instructions a file. - Several destinations: a rerun no longer duplicates each landing's directory unless two landings can share the door's cursor (one
-dinside another, or a landing that is itself a-d), decided from the paths alone. - A rerun over a directory whose mode shuts its owner out (0607) completes where hpcp holds the directories, and a non-root move sets such a directory's exact mode after its removal step, also where the removal was skipped (9.89 could exit 193 on the rerun, and left 0707 after a skipped removal). Where no finish sets a directory's mode (
-nds,-co, a destination named with-dthat no source directory lands on), a directory the run opened to its owner keeps owner read, write and search (0607 becomes 0707), and on macOS one with no owner read at all can be left 0700 (a known limitation). - A rewrite of a file another program holds a write lease on keeps its inode: the open waits for the lease's break (up to
lease-break-time, 45 s by default, for each such file); without /proc the file is rewritten beside, as in 9.89. - A destination named with
-dthat is a link is worked out once a file: a retry after a failed first attempt writes where the first attempt went, and a dangling link that appears at a named landing later is refused as at the first look. - A pinned destination refused in one process is said where another destination takes the file:
Note: B now leads to another directory than the one this run started writing in; ..., once a process, with no error (9.89 said nothing). -lt: a target that holds a link to itself and fails to copy is tried once (9.87 to 9.89 printed the sameCopy failedline about 990 times).- A device node copied by a non-root user onto a
-dlink saysCopy failed: cannot make a device node like /dev/null here, ..., as 9.87 did. - A move's fsync of a file its owner may not read (mode 0044) gives the owner read through what it looked at (on Linux with /proc an
O_PATHdescriptor checked against the look; on macOSlchmodby name); without /proc the chmod follows a link, as in 9.89. - Python 3.6 with forkserver or spawn: an early Ctrl-C prints a worker's
EOFError: Ran out of inputmore rarely (a known limitation below Python 3.8); the run ends 130 with nothing lost. - macOS:
- a rerun carries a source's changed or removed xattrs and ACL to a file or directory hpcp holds (not an identical FIFO or device node, nor the ACL of a directory reached by path). It mirrors the source: an xattr only the landing has (a Finder tag, a program's own) is removed, but never the marks macOS keeps itself (
com.apple.quarantine,com.apple.lastuseddate#PS,com.apple.provenance,com.apple.macl). It costs about 11 µs a file or directory, so a pooled rerun of a tree of many one-file directories takes 4 to 6 % longer than 9.87's (a known limitation); - a directory's BSD flags, and an identical file's, are set through the descriptor hpcp holds (
fchflags), where-d out/withouta link gave the link the flags; - a socket named as a source is skipped with a note (
Special file skipped: sock is a socket; ...), exit 0, as one met in a tree is and as macOS'scpdoes; a move leaves it in place. 9.89 exited 213 there and its move kept every source. No socket is made on macOS (a known limitation); Linux is unchanged; - a paced parallel remove (
-rm -pfl -F N) no longer waits about as long as hpcp had run before each unlink: its workers share one clock; - where macOS refuses to raise the soft open-files limit to the hard one (
RLIM_INFINITY), hpcp raises it to OPEN_MAX (10,240).
- a rerun carries a source's changed or removed xattrs and ACL to a file or directory hpcp holds (not an identical FIFO or device node, nor the ACL of a directory reached by path). It mirrors the source: an xattr only the landing has (a Finder tag, a program's own) is removed, but never the marks macOS keeps itself (
Upgrading to 9.89 from 9.88
Nothing needs doing to upgrade. What changed:
- A rerun to one destination costs 9.87's CPU again, with 9.88's guard whole: 9.88 holds each directory on the way to a landing by descriptor (a directory swapped for a link is never followed, and the
-dpin holds), and that cost a rerun with nothing to copy about 6 to 14 µs more CPU a file than 9.87, in Python on each landing's way. 9.89 takes that work out: the held directory's descriptor is lent to each landing instead of duplicated and closed, a directory the process already stands in is answered without a walk, a level is opened without a helper call, each landing's path is worked out once, and equal times are compared at once. The guard's own calls stay: each directory a process enters is still opened and closed, and every name below it is made, looked at and written relative to it. Measured on a tmpfs in Docker, Python 3.14, the versions taking turns, on a mostly quiet host (load 2 to 5 in the serial runs), CPU seconds against 9.87 (medians; 9.88 in the same turns in brackets): a serial rerun of 10,000 directories of one file +0.5 % in 11 rounds (0.935 s against 0.930 s; 9.88 +11.8 %) and −0.7 % in 13 more (+11.4 %), and of 50 directories of 1,000 files −0.7 % (2.13 s against 2.15 s; +12.4 %) and −0.1 % (+14.0 %); in the default pool (9 rounds) −1.7 % and −2.8 % (+7.0 %, +13.2 %), by the clock −0.7 % and −9.4 % by medians (+3.0 %, −0.7 %; by the minima +7.3 % on the wide tree: the pool's wall time moves with the host); with-j 2−1.7 % and −1.2 % (+6.4 %, +10.4 %); a serial first copy of the 10,000 directories −10.8 % (+0.3 %). A serial rerun's CPU a file, less the start (21 rounds): −0.5 % and −1.5 %. Counted instructions a file, less the start (perf, the container alone, which the host's load does not move): −3.3 % and −2.9 % on Python 3.14 (9.88 +6.2 %, +7.4 %), −9.2 % and −2.4 % on 3.11 (+0.3 %, +8.1 %), and −9.4 % and −9.8 % on 3.6 (+3.2 %, +8.1 %). The start itself (importing hpcp) takes about 3 to 6 ms more CPU than 9.87's, as in 9.88 (a bigger file). A rerun to one destination makes the same system calls a file as 9.87. With two destinations (-d out/ -d out2/ -s) a rerun costs a little more than 9.87's: each landing of a file is duplicated and closed there (9.88 did it for every landing, one destination too). Measured as above, 13 rounds, nothing to copy: CPU +1.4 % for the 10,000 directories of one file (1.221 s against 1.203 s; 9.88 +13.9 %) and +2.3 % for the 50 directories of 1,000 files (2.553 s against 2.496 s; +15.5 %), the host busier (load 5 to 14; the wide tree's paired ratios +2.4 %, quartiles +1.2 % to +2.8 %), and a quieter host (11 rounds, load 2 to 4) +2.2 % and +3.3 % (paired +2.0 % and +3.6 %; 9.88 +14.5 % and +16.6 %), so about 1 to 4 %; counted instructions a file, less the start, −2.9 % and −2.5 % (9.88 +9.2 %, +10.1 %) while the run's user cycles are 4.7 % and 3.5 % above 9.87's (5.33 G against 5.10 G, 11.27 G against 10.89 G): the extra CPU is slower instructions, not more of them (the cause is not profiled; the duplicate and its close of each landing's directory are the new calls); deciding it once a run is planned for 9.90 (see docs/limitations.md). On macOS (APFS, Python 3.9.6; measured at 187864e, before the door's one-entry memo of its last answer was dropped; not measured again) a serial rerun and one with-j 2now use 6.6 to 9.3 % less CPU than 9.87's; a pooled rerun of 10,000 directories of one file still takes 2 to 4 % longer (see docs/limitations.md). On an NFSv4.1 loopback mountedactimeo=0(an EL8 VM, measured at 187864e too, not again; 20,000 files in 2,021 directories, 2 rounds) a first copy and a rerun make the same GETATTR and LOOKUP calls as 9.88 (388,072 and 388,102 GETATTRs on a first copy against 388,081 and 388,156; 253,875 and 253,849 on a rerun against 253,789 and 253,838). - pip installs no multiCMD for hpcp: hpcp runs the multiCMD it carries (1.61) wherever an installed one is older, missing or does not import, so its requirement (
multiCMD>=1.56) guaranteed nothing; and with stock pip 9 (EL7, EL8) and multiCMD 1.57 or older installed,pip3 install -U hpcpstopped withconfigparser.DuplicateOptionError(exit 2, hpcp not installed). Checked with pip 9.0.3 on Python 3.6 over multiCMD 1.56: 9.89 installs, and 9.88 upgrades to it (exit 0, multiCMD left as it is). An installed multiCMD 1.61 or later is still the one hpcp uses; a multiCMD installed only for hpcp can stay or go (pip3 uninstall multiCMD). Nor doesuv run hpcp.py(the script header). cas-toolbox installs multiCMD for its own commands. - Planned for 9.90: what 9.88 planned for 9.89 (see Upgrading to 9.88), except the rerun's CPU, which 9.89 took out; and four more: a rerun to several destinations that costs about 1 to 4 % more than 9.87's (above); a serial run draws its progress bar after every file, about a third of a serial rerun's instructions a file, where a frame every 0.1 s would do; with
-lt, a link whose target directory holds the link and whose copy fails repeats its error about 990 times (old); and a-dlink retargeted between a failed attempt at a file and its retry gets the new name written into the old directory (old; see docs/limitations.md).
Upgrading to 9.88 from 9.87
Nothing needs doing to upgrade, except in a program that calls sync_directories_serial_batch or sync_directories_parallel_batch (below). What changed:
- A directory on the way to a landing can no longer be swapped for a link mid-run: each process holds the directories from the destination named with
-ddown to the landing it writes, by descriptor, opened one level at a time without following a link, and makes, opens, renames, links and settles every name relative to them (ascpdoes with the held file it is given since 9.87), the directory sync and its finish too. A user who could write a directory below the destination could swap one for a link (to/etc/cron.d, say), and the rest of a root run's files for it went there. A job's files are copied in path order. The cost, against 9.87: about 2.4 more system calls a file, all on descriptors (a duplicate of the held directory's descriptor and its close, and an open and a close for each directory level entered), and about 2.4 to 4.4 more a directory synced. Copying 100,000 files of 4 KiB in 10,000 directories was faster on a first copy and as fast on a rerun in the build's pool bar (Docker, Python 3.14, a 32-core host, medians of 5: a first copy 9.1 s against 11.3 s, a rerun with nothing to copy 2.5 s against 2.5 s). A rerun costs more CPU than 9.87's, though: about 6 µs a file of Python on a tree of many files a directory (about 14 µs a file with one file a directory), more than the pool bar showed, since its parent's listing hides the workers' CPU (measured on a tmpfs in Docker, Python 3.14, the versions taking turns, CPU seconds; medians of 11 for the serial runs and of 9 for the pool's): a serial rerun with nothing to copy of 50,000 files in 50 directories took 2.69 s against 2.40 s (+12 %), of 10,000 files in 10,000 directories 1.16 s against 1.02 s (+14 %); in the default pool the 50-directory tree's rerun took 5.8 % longer by the clock (0.81 s against 0.77 s) and the 10,000-directory tree's 0.4 %, and with-j 2the first 9.5 % longer (1.23 s against 1.12 s). A first copy is not slower (a serial one of 10,000 directories of one file, 6.26 s of CPU against 6.60 s, 3 rounds). 9.89 took it out (see Upgrading to 9.89). On macOS (APFS, Python 3.9) a rerun of 10,000 directories of one file each took about 6 % longer, and 5 to 15 % longer with-s(a loaded Mac: median 3.36 s against 3.18 s in 11 rounds, and 2.83 s against 2.70 s; a quiet one: 3.26 s against 3.08 s, and 2.82 s against 2.47 s); 50 directories of 1,000 files took 0.6 to 2.7 % longer (5.31 s against 5.28 s loaded, 5.04 s against 4.91 s quiet) and a first copy of 3,000 directories of one file each 0 to 3 % (19.3 s against 19.4 s loaded, 19.2 s against 18.7 s quiet; medians of 3): each directory a process enters costs an open and close of about 20 µs there, against about 0.5 µs on Linux, on top of the per-landing cost above (a known limitation, see docs/limitations.md). On an NFSv4.1 loopback mountedactimeo=0(an EL8 VM, medians of 4) a first copy made about half the GETATTR and LOOKUP calls (2.05 million against 3.96 million; 603 s against 635 s) and a rerun a third (1.40 million against 4.13 million; 57 s against 171 s); with the default attribute cache both took as long (medians of 2: 418 s against 426 s, 27 s against 26 s). Known: on macOS a FIFO, socket or device node copy and BSD flags, and on Linux without /proc an identical node's mode, still go by name below the held directory; so do an identical node's xattrs and a vfat file's attribute bits on Linux without /proc, and every level below half the open-files limit (128 on macOS's default), after the process runs out of descriptors, or in a directory the runner may not read where the door holds read descriptors (macOS, Linux without /proc), as 9.87 did everywhere, and Windows, which has no descriptor calls, goes by path everywhere (see docs/limitations.md). 9.90 plans to close the identical node's xattrs and attribute bits and the three by-path places (planned for 9.89 until then); the macOS node copy, the BSD flags and the Linux-without-/proc node mode are approved known limitations with no plan, and Windows stays as it is. - A destination named with
-dis pinned for the run: a run notes which directory it leads to when the copy starts; a process that finds it leading elsewhere later (someone swapped it for a link) writes nothing below it and says so once (Destination clash: DEST now leads to another directory than the one this run started writing in: not copying ..., exit 213, and a move keeps those sources). A rerun writes where it leads then. 9.87 followed it whenever a worker opened it. - A Ctrl-C while hpcp starts is acted on: one pressed in the first half second, while Python imports hpcp, was sometimes dropped (the run went on, and with
-rfmoved); it now stops the run. Importing hpcp no longer runsuname -peither (Python 3.6 to 3.8). Known: one that lands while Python itself is still starting, before hpcp's first line, can still be dropped (2 in 12,000 test stops); a second Ctrl-C stops the run (see docs/limitations.md). - Python 3.6: an early stop no longer hangs the run in a pool's submit: a second Ctrl-C was ignored there; on 3.6 hpcp now hands each job to the pool itself and acts on a stop within 0.1 s.
- Python 3.6 and 3.7 with
forkserverorspawn: an early Ctrl-C no longer prints a traceback from Python's semaphore tracker. - multiCMD 1.61: the embedded copy (used where no multiCMD 1.61 or later is installed) starts its command wrapper's Python with Ctrl-C blocked until it has the command, so a Ctrl-C that lands as
cpstarts no longer crashes that Python on 3.6 to 3.10 (a core dump on 3.6 and 3.7, "Fatal Python error" on 3.8 to 3.10, its message in the command's stderr; multiCMD's own aimed test: 80 of 400 starts crashed on 3.6 and 63 on 3.7 with 1.60, none with 1.61); and, from 1.60, it no longer leaves Python's thread-start lock held when a Ctrl-C lands as it starts a thread, which hung the run for good (about 1 in a million early stops, in the 9.87 review's estimate), and it loads inside the Ctrl-C mask of hpcp's own imports. - A move: into a new
-dpath fsyncs each directory it made and the one holding the first (a power cut on vfat could lose that name); a non-root move of a directory whose mode shuts its owner out (0607) completes, its exact mode set after the removal step when the copy reported no errors, and after a stop or a copy's errors only for a directory whose source directory is gone (the others keep owner read and search until a rerun). Known: where a source directory stays after a copy with no errors (a file replaced by a later merged source, a directory the removal could not remove), its landing gets the exact mode all the same, and a rerun over it can fail below it (see docs/limitations.md). - Merged sources (
hpcp a/ b/ -d out/, ora/ bwitha/b/there) sync a directory they share once, from the later source, as the files go; and a rerun on vfat, exFAT or HFS+ no longer sets every directory's times again. Known: with-nbsuch a directory is still synced once per source, so where the sources' modes or times differ a rerun sets them again and moves its change time, as in 9.87. - Library:
sync_directories_serial_batchandsync_directories_parallel_batchsync a destination directory that several of their jobs (or a job's root and its listing) share once, from the last job that has it, and return one record for it; before, each job's sync ran and each returned its record. - macOS: an identical FIFO or device node's owner and mode are set without following a link; a non-root run sets only the user BSD flags, so a list of paths below
/Users(which has the system flagsunlnk) copies and moves (9.87:Directory sync error: /Users to out/Users: [Errno 1] Operation not permitted, exit 193). - A program that imports hpcp: a Ctrl-C during
import hpcpis held to the end of hpcp's imports, while no other thread takes it; and one that keeps Python's own Ctrl-C handler no longer leaves an empty file at a first copy's landing, or a file of the held-file probe in the temporary directory (the probe no longer usestempfile). - Planned for 9.90 (planned for 9.89, which took out only a rerun's extra CPU, about 6 to 14 µs a file, above): a root
-siffapply into a target a user can write still writes below it by path; a non-root rerun over a directory of mode 0607 with more than 64 subdirectories can exit 193 (Permission deniedbelow it; 9.87 failed more often), and a move that leaves a source directory sets its landing's exact mode all the same; a device node copied by a non-root user onto a-dlink says the copy beside failed, where 9.87 said it could not make the node; on macOS the BSD flags of a-dlink's directory go to the link; a move's directory fsyncs go by path; a pin refused in one process says nothing when another destination takes the files; a chmod in a move's fsync of a file of mode 0044 follows a link put at its name; a rewrite of a file whose landing a client holds under a write lease goes beside it, a new inode; on macOS a rerun carries no changed xattr or ACL to an identical file, a named socket in a source ends in exit 213 (macOS'scpskips sockets), and the copy check looks at each landing by path on a network mount too (see docs/limitations.md).
Upgrading to 9.87 from 9.86
Nothing needs doing to upgrade, except in a program that calls sync_directories_serial or sync_directories_parallel, which are removed (below). What changed:
- A stopped run ends: a run stopped with Ctrl-C, SIGTERM or SIGHUP, or one whose copy worker dies, no longer waits for good on Python's process pool (9.85 hung in 9 of 3,300 early stops in the reviewer's probe on Python 3.6 and 3.14, and 9.84 about as often: a stop raised inside the pool's own lock handling, a worker stuck between files, a result a killed worker half wrote). The main process acts on a stop only between its waits, within 1 s; a worker between files that is still there 4 s after the stop is killed (it holds no temporary file); a worker in a file is waited for, so its cleanup still removes its temporary or torn file; and a pool whose worker died and that then stops answering for 4 s ends the run with exit 191 (
Copy process crashed: a pool worker died and its pool stopped answering). A stop still exits 130 for Ctrl-C, and by its signal for SIGTERM and SIGHUP. Known, on Python 3.6 only: an early stop while a pool takes its first jobs can still hang the run for good (about 3 in 2,000 early Ctrl-Cs in the review's probe, 9.86 4 in 716); a second Ctrl-C then prints nothing and SIGTERM does nothing, and Ctrl-\ orkill -9ends it (planned for 9.88; done in 9.88). - A stop Python drops is acted on: a
KeyboardInterruptthat Python drops in the main process (raised in a weakref callback or a__del__) was not acted on: during the copy the run ended with exit 191 instead of 130, and outside it the run went on to its end, a move removing its sources. The stop is recorded first and acted on at the next check: each pass of a pool loop, each file of a serial copy, and before every phase, the move's removal among them. - No traceback on an early Ctrl-C on Python 3.14: a worker's stops stay blocked until hpcp's handlers are in, under every start method (3.14's forkserver too); about one early Ctrl-C in three printed a
KeyboardInterrupttraceback before, as in 9.84. On Python 3.6 and 3.7 a stop that lands where Python drops it (a weakref callback or a__del__, as a thread or a pool worker goes) is recorded and acted on, nearly always without theException ignoredtraceback Python printed for it (9.86 printed it in about one early Ctrl-C in 100 on a loaded host, 9.87 in about one in 2,000, below; 3.8 and later already hid it). A worker that gets its Ctrl-C twice (from the terminal, and passed on by hpcp) no longer printsException ignored ... Signal 2 ignored due to race conditionas it ends (about one early Ctrl-C in 150 on 3.14; Python 3.6 to 3.9 raisedTypeErrorthere instead). - A second stop says how to end at once: later stops are still ignored, so the cleanup is never cut halfway; the first of them prints
Stopping: cleaning up first (cp stopped, temporary files removed, images unmounted); Ctrl-\ ends hpcp now, which may leave them(not in the 3.6 hang above). - Directories end with their source's mode and times: a directory's times, exact mode and BSD flags are now set after what goes in it (its files, its links,
-rme's removals), deepest first, ascp -aand rsync do; its owner, xattrs and a mode that still lets its owner in come first, when it is made (a rerun opens a restrictive directory the runner owns before it sets its xattrs, so a source's changed xattr reaches it too: it never did on a directory of mode 0555). 9.86 set them all before its files went in: a non-root copy of a directory of mode 0555 or 0444 holding files exited 190 with the directory empty, and every directory that got a file, a link or a subdirectory kept the copy's time until a rerun (in a probe, 3 of 7 directories on Python 3.14 and 5 of 7 on 3.6). While a non-root run copies, each of its own directories whose source mode lacks owner read, write or search is open to its owner (u+rwx) until the end; a stopped run leaves it so until a rerun. A clean rerun sets nothing on a directory that already matches, except those restrictive ones: two mode changes each; a read time that alone differs is left, as a file's is (a listing moves it under relatime). With-codirectories get no metadata, as before. - A move writes its directories to disk: once every directory has its metadata, the move fsyncs, once each and in
-jthreads, each directory the copy synced and every other directory it wrote into: the directory of each file and link it landed (under-ndstoo), the directories between the destination and those (under-ndsno folder sync made them, and each holds a new name) and the parent of each source's landing. A directory whose final mode shuts its non-root owner out (no owner read) is fsynced at the finish, through the descriptor that set that mode. On ext4 and XFS the first of these fsyncs commits every change before it, so the move of 2,040 empty directories took 0.50 to 0.79 s against 9.86's 0.44 to 0.78 s (EL7 and EL8, ext4 and XFS, 3 runs each). All before any source is removed; one that fails is a failed copy (Copy failed: the directory DIR cannot be written to disk (why), exit 212, every source kept). 9.86 fsynced only the directories it made links in: after a power cut within the journal interval an empty directory, a directory's mode, owner or times, or (outside ext4 and XFS, where a file's own fsync commits its name) a file's name could be missing with its source gone. Known: another user's directory the runner may not read (a write-only drop box) cannot be opened, so the files and links moved into it are not fsynced there (see docs/limitations.md). - A move runs at least 16 workers by default: each worker waits on its files' fsyncs (the 9.85 review measured a move of many small files taking 1.6 to 1.9 times as long as a copy), so with
-rmor-rf(a move, or a removal without-d) the default-jis 16, or the CPU count where that is more, where a copy's stays one a CPU;-jstill sets it. The fsyncs in flight are what the disk needs, not the CPUs: on 32 CPUs and a fast disk, 4 workers a CPU (an earlier 9.87 build) made a move of 2,000 files of 4 KiB 20 % (Python 3.14) to 45 % (3.6) slower than 32 workers, and on 3.6 to 3.8, which start every worker of a pool at once, a move of 100 files took 0.60 s against 0.32 s. Moves of 4 KiB files, 9.86's default against 9.86 with-j 16against that earlier 9.87 build's 4 workers a CPU (3 runs each, interleaved, Python 3.6): on an EL7 VM (2 vCPUs, so that build ran 8 workers, and 9.87 runs 16) 2,000 files took 22.6 to 29.3 s, 11.5 to 14.3 s and 12.4 to 15.0 s on ext4, and 19.0 to 24.6 s, 10.9 to 12.1 s and 11.5 to 13.0 s on XFS; 10,000 files 97 to 119 s, 58.5 to 59.2 s and 59.7 to 68.3 s on ext4, and 83 to 96 s, 48.7 to 54.0 s and 50.0 to 61.1 s on XFS; on an EL8 VM (4 vCPUs, 16 workers) 2,000 files 15.9 to 17.1 s, 9.3 to 15.5 s and 10.7 to 11.3 s on ext4, and 14.5 to 15.2 s, 10.3 to 11.8 s and 8.5 to 11.9 s on XFS; 10,000 files 69.5 to 77.4 s, 40.9 to 49.5 s and 36.4 to 53.6 s on ext4, and 61.5 to 73.8 s, 36.5 to 42.6 s and 38.5 to 44.7 s on XFS. 4 files of 256 MiB took as long as before (1.3 to 1.5 s against 1.3 to 7.1 s on ext4, 0.9 to 1.4 s against 0.9 to 3.0 s on XFS, both VMs). A failed fsync now removes only the file the copy wrote: one put at the name since is someone else's, and stays. - On macOS a move asks each destination's drive once to flush its cache: there
fsyncreturns once the data is in the drive's own write cache, so a power cut soon after a move could lose both the copy and the removed source. After its fsyncs and before any removal, a move callsfcntl(F_FULLFSYNC)once per destination filesystem (Apple: it "drains the entire queue of the device and acts as a barrier", so every earlier fsync there is on the drive). A filesystem that cannot be asked (SMB, FUSE) getsNote: the drive under DIR could not be asked to flush its cache (why): ...and the move goes on, as 9.86 did; a landing its owner may not read (a copy of another user's file of mode 0044) is asked through its directory, on the same filesystem, and where that is refused too (another user's write-only drop box) it is the Note too; a flush that fails is a failed copy (exit 212, every source kept). Linux has no such call, so nothing changes there. From Apple's documentation, and run here only with a stand-in for the call; the 9.87 macOS check runs it on GitHub's macOS runners (VMs, so it shows the call works, not a real drive's time). cp --versionkeeps only an answer: acp --versionthat timed out (10 s, on a thrashing host) or could not start is asked again at the next copy, where 9.86 kept its no for the worker's life, so that worker copied without--sparse=alwaysand gavecpa rewrite's landing by name instead of the held file.-dis folded once:hpcp a/ -d l/../out/, withla link todeep/inner, copies intoout/as before and no longer also makes an emptydeep/out/(one step made the directory by the path as given, where the kernel followslbefore..). A link before..in-dis not followed: the path is read as written. An empty-d ''is still no destination given (Destination path not specified, using ..., as in 9.86), not the working directory: a script's unset variable in-d "$DEST"must not spill the source there.- A
-siffapply reads its lists' names as bytes: with LANG unset (Python 3.6 on EL7, cron), an apply stopped at the first non-ASCII name with a UnicodeEncodeError; it reads the change list and the manifest as the filesystem's bytes now, so a patch made under any locale applies under any other. The change list, the manifest and a-tdfllist are written as each name's own bytes (the filesystem's encoding: under a Latin-1, EUC-JP or KOI8-R locale an earlier build wrote UTF-8, and its own patch was refused withIncomplete patch: payload missing or unsafe, nothing applied); the disk table holds tool output (labels, GPT names) and stays UTF-8, as in 9.86. Under UTF-8 and the C locale the files are as before. A patch that 9.86 or an earlier release made (its manifest names the hpcp that made it) holds its names as UTF-8, and is still read as that release read it, so one made and applied under a Latin-1 locale applies as before; where the locale cannot spell a name read so (LANG unset, where 9.86 stopped), the name's bytes are taken as they are. And 9.86 applies a patch 9.87 made (each way checked under Latin-1, C and UTF-8 locales, the patch made and applied under the same one). - Hints give commands a shell runs as pasted: the commands a hint gives (the replaced-link Note's
hpcp SRC/ -d DIR/, the-ncdrefusal's-d DIR/, andrm LINK/chmod u+rx DIRfor a place that cannot be searched) quote each path for a POSIX shell: as is when safe, in single quotes, or as$'...'with octal bytes for a control character or a name the locale cannot show (bash, ksh and zsh read that form; dash 0.5.12 does not). 9.86 printed them as Python holds them (d\udcc3\udca9), which no shell reads back, and a space split the command. Messages that only name a path are unchanged. -enescounts only what the copy will write: where a source's listed size does not fit the destinations' free space, hpcp now counts what the copy will write before it skips the source, with onelstatof each file and of its landing (at the first destination holding one): nothing for a landing of the same size and time (any time under-co), which the copy skips; what the source takes beyond the old copy for a rewrite in place; and the whole file for a new file, or for a rewrite beside the old copy (-wb, or a landing with several names). 9.86 compared the listed size, so a rerun with nothing to copy onto a nearly full destination skipped the source (Not enough space: ..., exit 228; a 3 MB file on a 5 MiB tmpfs); it now exits 0. A source whose listed size fits is not looked at, as before, andRequired:gives the counted size.- A
-corerun copies only what changed:-cocarries no times, so 9.86's skip check (size and time) never matched and every rerun rewrote every file. A landing of the source's size now counts as the same when both read the same to the end, whatever its time, so a rerun with nothing changed reads both copies and writes nothing; a change anywhere in a file is copied (not only in the last-hsbytes the skip hash reads). Under-hs 0("file attributes only") a-corerun rewrites every file, as before. -rmejudges a directory by where the copy put its directories: as a file is judged, by the landings of the directories the sources hold (from the copy's own listing) and of the sources themselves, with every directory on the way to them. 9.86 judged a directory by whether its path below the destination existed below each source's parent, sohpcp a/ b -d out/ -rmerun where a directoryzzzlies besidebkept an extraout/zzz; it is removed now (only when empty, as every directory removal). Lists and-diimages go by the same rule, and a destination that reads two spellings of a name as one is still asked, as before.- A rerun looks once at each landing, and settles an identical file through one checked descriptor: each landing is looked at once (one
lstat, which the skip check, the copy and the space check share), and a landing found identical to its source gets what the skip has always given it (stale portable xattrs removed and the source's set, owner and group ascp -akeeps them, mode, BSD flags, and the times where the modification time differs) through one descriptor (O_PATH | O_NOFOLLOWon Linux; off Linux an identical FIFO or device node still gets its mode and owner by name, planned for 9.88, see docs/limitations.md) checked against that look, and each only where it differs. 9.86 set them all by name on every rerun, so a landing swapped for a link (or another file's second name) between the look and those calls gave that other file the source's owner and mode, and every rerun moved every landing's change time. A read time that alone differs is left: a read moves it under relatime (the skip check's own read does), so chasing it would set it on every rerun. A landing that keeps changing while it is looked at (3 looks) is a failed copy (Copy failed: ... it kept changing while it was looked at, exit 190); one whose metadata cannot be set (a read-only mount, another user's file) isCopy failed: ... it holds the source's content, but its owner, mode, times or xattrs cannot be set (why), exit 190, where 9.86 ended 191 (Copy process crashed). A rerun onto a read-only mount with nothing to change exits 0 (9.82 to 9.86: 193). A rerun no longer drops a file's capabilities (security.capability): the xattrs are set after the owner, ascp -agives them, and the kernel clears a capability on every chown (9.86 removed it from every identical file on every rerun; one whose owner had to change is kept too now). In process (Docker, Python 3.14), an identical file costs 7.5 os calls against 9.86's 22.5, a rewrite in place 19.5 against 32.9, a first copy 19.7 against 23.9. On an NFSv4.1 loopback mountedactimeo=0(an EL8 VM, 4 vCPUs, the host busy), a rerun with nothing to copy of 100,000 files of 4 KiB in 10,000 directories took 252, 296 and 333 s against 9.86's 1,333, 1,227 and 982 s (3 runs each, interleaved; 4.07 million GETATTRs a rerun against 12.87 million, and 100,000 SETATTRs against 540,000, measured before the read-time change above and with the copy check's earlier form, below), and reruns of 10,000 files one after another now make no SETATTR at all (9.87 before the read-time change: 10,000 each). Measured again just before release, in one more round on the same VM with the host busier (load 100 to 270), a rerun took 687 s against 9.86's 1,808 s, with 4.02 million GETATTRs against 12.87 million and no SETATTR against 540,000, and a first copy of the same tree took 1,513 s against 2,093 s. - The copy check looks again only where two landings may be one file, and goes by directory on a network filesystem: after a copy, and before a move's removal, the landings are looked at a second time only for the entries whose fingerprint met another's (two landings that may be one file); 9.86 looked at every landing again, about 0.45 s per 100,000 files on a local disk. Where a destination is on a network filesystem, each landing is
lstated relative to its directory, opened once for the names in it, so a path is walked once a directory rather than once a landing. Only NFS was measured: on an NFSv4.1 loopback mountedactimeo=0(an EL8 VM, the host busy), reruns with nothing to copy of 100,000 files in 10,000 directories took 127.8, 127.0 and 314.8 s against 163.9, 147.3 and 340.1 s looking by path and 1,002, 513 and 1,352 s in 9.86 (3 runs each, interleaved); the check itself 9.5, 10.4 and 21.5 s against 23.1, 23.1 and 47.5 s, with 4.06 million GETATTRs a rerun against 4.61 million (9.86: 12.87 million). Lustre, GPFS, CIFS/SMB3, CephFS and BeeGFS take the same route, unmeasured, because their clients ask the server along a path walk in the same way. hpcp reads each destination's type once, from Linux's mount table. On a local disk, and off Linux, each landing islstated by its path, as in 9.86: there the directory opens cost more than they save (10 to 25% slower in Docker), and the check is as fast as before (100,000 landings in Docker: 0.329 s against 0.332 s looking by path, and 0.327 s in 9.86). Reading each landing directory once (scandir) was tried and dropped: its entries carry no size, time or link count, and its inode numbers are made up on vfat and FUSE exFAT (see docs/limitations.md). - A copy that crashes is that file's failure, and an unsearchable directory is a failed copy: a landing below a directory the runner cannot search (another user's mode 0700 directory on the way) ended
Copy process crashedand then a falseDestination clash: copied SRC, but it is at none of its landings(213) in an earlier 9.87 build, where 9.86 endedCopy failed(193); it is 193 again. Any crash inside one file's copy (191) is now recorded as that file's failure, so the copy check no longer adds the false 213 for it (9.86 did add it). - Error lines start their own line in a log: with stdout and stderr in one file (
> log 2>&1), an error a worker printed (Copy failed: ...) could follow the progress bar on the bar's line, sogrep -c '^Copy failed'counted 9 to 11 of 12 failures in 9.86; and on Python 3.6 to 3.8, which hold a redirected stderr's output until a flush, an error the main process printed (under-s, for instance) could land later, on a bar frame's line. An error line that may land on the bar's line now starts with a newline, or on a terminal (also through| tee) clears the bar's line first (ESC[2Kand a carriage return); with stderr in a file of its own nothing is added; and each error line is written and flushed at once. 12 files that cannot be read now give 12 lines starting withCopy failedin every run (6 runs each, with-j 4and with-s, on Python 3.6 and 3.14). The text of each error is unchanged. - A landing's name can no longer be swapped for a link mid-run, on Linux and macOS, wherever
cpwrites the file hpcp holds: a first copy is now a file hpcp makes (O_CREAT | O_EXCL | O_NOFOLLOW: never through a link put at the name), andcpwrites it through the descriptor it inherits, as it writes a rewrite in place:/proc/self/fd/Non Linux,/dev/fd/Non macOS (where 9.86 gave even a rewrite the name; on macOS from Apple'scpandcopyfilesources, and run by the 9.87 macOS check on GitHub's runners). The beside route's new file (-wb, a file with other names) is made and written the same way, and its xattrs,-cocarry-over and fsync go through that descriptor; a name put at it before its rename keeps the old copy (exit 190,... it could not be replaced by the new copy (something else was put at its name)). A landing removed between hpcp's look and its open is such a first copy. A name put at a first copy's landing between the look and the create is looked at again and judged as the first look was: a dangling link the operator named is refused (exit 190, as 9.86'scprefused it; a root run made the file where the link points in an earlier 9.87 build), and a directory is refused (Destination clash: DIR is a directory, not copying SRC over it, exit 213; 9.86'scpcopied into it, through a link inside it). A link to a file at a name given with-d(hpcp a/x -d out/y) is still followed, whenever it appears, before the run or planted after the look, as in 9.86: the operator named that place. 9.86 gavecpa first copy's name and the beside route's temporary name, so a link a user who can write the destination put there in that moment was written through by a root run, and a second name of another file put at the temporary name lost its xattrs. The new file ends ascpby name made it (mode, owner, group and ACL checked againstcpby name for source modes 0644, 0600, 0755, 4755, 2755, 1777, 0444 and 0000, umasks 022, 077 and 002, with and without a default ACL, as root and not): it starts at mode 0600 forcp -a, which gives it the source's mode when it ends, and at the source's permission bits under-co(cp -f); a plain run gives it the source's SELinux label beforecpwrites it, and its owner and group oncecphas written it, ascp -aby name does (given first, XFS charges the data to the owner's or group's quota while root writes it, and a user or a group at the hard limit gotDisk quota exceededwhere 9.86 completed; shown on XFS with a 1 MiB limit). Where a default ACL gave the new file entries of its own, whichcp -anarrows away from a file it did not make before it gives it an owner, a non-root run gives its owner and group first where the source is the runner's own and the runner can give its group, and a root run gives nothing first, so it keeps the held route only for a source whose owner and group the new file already has (root:root, or root and the group of a setgid directory); otherwisecpmakes that file by name, as in 9.86: in a non-root run that cannot give them, and in a root run whose new file's owner or group differs from the source's, where giving them first would charge root's write to that user's or group's quota.cpgets its own process's descriptor, so the route also works where 9.86 gave the name: a/procmountedhidepid, a PID namespace whose/procis an ancestor's. It is asked once a run, by doing it:cpcopies a 1-byte temporary file onto a held temporary file, and what that file then holds is the answer (acpthat writes through without truncating gets the held file emptied first); the parent asks, as it opens a copy pool, and hands each worker the answer, so no worker makes a temporary file (an early Ctrl-C met each worker's own probe, and left itshpcp-held-probe-*file in the temporary directory on 40 of 2,100 runs on Python 3.6). It costs 19.7 os calls a first-copied file in process (9.86: 23.9); 20,000 first copies of 4 KiB took 2.03 to 2.38 s (median 2.25 s) against 9.86's 2.01 to 2.45 s (2.15 s), and 20,000 rewrites with-wb2.48 to 2.69 s (2.60 s) against 2.52 to 2.65 s (2.58 s) (Docker, Python 3.14, 6 rounds each, interleaved). Wherecpcannot write a held file (the BSDs; BusyBox's and uutils'cp; no usable/procor writable temporary directory), and for those first copies into a default-ACL directory, it gets the name, as in 9.86 (see docs/limitations.md). - hpcp carries multiCMD 1.59: an installed multiCMD older than 1.59 is passed over for the copy embedded in hpcp, which passes the held file's descriptor to
cp;pipstill asks only formultiCMD>=1.56, so nothing is upgraded on install. - Removed from the library:
sync_directories_serialandsync_directories_parallel, which nothing in hpcp called.sync_directories_serial_batchandsync_directories_parallel_batchstay: they take a list of(src, dests)jobs and return the links and the directory records, whichfinish_directories(records, max_workers)finishes once the files are in (the removed functions finished them at once). - Known: a stopped run waits for a worker whose file operation never returns (a write or fsync to a dead hard-mounted NFS server, a disk in an uninterruptible wait): hpcp prints
Waiting for N worker(s) still finishing a file (pids ...), and Ctrl-\ ends it at once, which can leave that worker's temporary or torn file (see docs/limitations.md). - Known: where
cpcannot write a file hpcp holds, or is not given it, a landing can be swapped for a link mid-run, as in 9.86: on the BSDs; on Linux with BusyBox's or uutils'cp, or without a usable/procor writable temporary directory; and for a first copy (or the beside route's new file) into a directory whose default ACL gives it entries of its own, by a non-root run that cannot give its owner and group, or by a root run of a file of another user or group. Use-wbthere for a root run into a tree others can write (see docs/limitations.md). - Known, on Python 3.6 and 3.7 only: an early Ctrl-C now and then still prints Python's
Exception ignored ... KeyboardInterruptblock (about 1 in 2,000 early stops, against about 1 in 100 for 9.86); the run stops as it should and nothing is lost. Python before 3.8 prints it itself; 3.8 and later never do (see docs/limitations.md). - Planned for 9.88 (done in 9.88): a directory on the way to a landing can still be swapped for a link mid-run by a user who can write a directory below the destination, everywhere; 9.88 walks every landing's directories by descriptors (see docs/limitations.md).
- Planned for 9.88 (done in 9.88): a move's
-dpath of new directories (-d new1/new2/withnew1missing) does not fsync the parent ofnew1; a power cut soon after the move can lose that name on vfat, with the sources gone (see docs/limitations.md). - Planned for 9.88 (done in 9.88): a move of another user's directory of mode 0607 (no search for its owner) holding a subdirectory copies it, then prints
Copy failed: the directory ... cannot be written to disk (Permission denied)and exits 212; every source is kept (see docs/limitations.md). - Planned for 9.88 (done in 9.88): merged sources set a shared directory's times twice per run, and every rerun on a filesystem with coarse times (vfat, exFAT, HFS+) sets them again, so a directory's ctime moves each run (see docs/limitations.md).
- Planned for 9.88 (done in 9.88): a Ctrl-C in the first tenth of a second, while Python imports hpcp, is sometimes dropped: the run goes on and exits 0, and with
-rfit moves; 9.86 does the same. On Python 3.7 withforkserverorspawna Ctrl-C in a child's own start-up can also print a traceback from Python's own code (exit 130 still; in 200 early Ctrl-Cs on 3.7,forkserver13 runs for 9.87 against 45 for 9.86,spawn28 against 187) (see docs/limitations.md).
Upgrading to 9.86 from 9.85
Nothing needs doing to upgrade. What changed:
- A rewrite is written in place again, and keeps its inode: a file that is already at the destination is opened by hpcp for writing (never through a link, never waiting on a FIFO) and
cpwrites that open file, as 9.84 wrote the file, so what the filesystem keeps on the inode stays: a Lustre or GPFS layout set withlfs setstripe,chattrflags, a project id; NFS readers keep reading it (noESTALE, no.nfsXXXXfor-rmeto find). On Linuxcpis given the worker's/proc/PID/fd/Nfor the open file, so a link put at the name during the run is never written through (asked once per worker by doing it:cpwriting to a descriptor of/dev/zero); off Linux, and where that cannot work (acpthat is not GNUcp, a/procof another PID namespace),cpgets the name, as in 9.84. Plain runs carry the source's mode, times, xattrs and SELinux label onto it (the label by hpcp, through the open file:cp -asets an existing file's label by name, which the/procname is not) and remove a staleuser.*xattr;-cokeeps the old owner, mode and xattrs. As in 9.84, a source that fails part way, a stop or a full disk can then cost the old copy (exit 190, the source kept), and a rewrite outside a move is not fsynced; a move still fsyncs every landing before any source goes. - Beside only where a write in place could corrupt, or with
-wb: a file with other names (a write in place would change them all), one that cannot be opened for writing (read-only for the runner, a running program), a source that is no regular file (a FIFO, socket or device node:cp -amakes it anew, which it cannot do to a file held open), anything the open finds changed since hpcp looked (never handed tocpby name), and a FIFO, socket, device node or link below a destination go beside and are renamed over what is there once whole, as in 9.85.-wb(--write_beside,--write-beside) does that for every rewrite, so a source that fails, a full disk or a stop leave the old copy as it was (exit 190), at 9.85's costs: a new inode (the layout,chattrflags and project id are not kept; NFS readers holding it open may getESTALE), an fsync of each new copy, a new name in the file's directory and room for a second copy. The beside route never falls back to writing in place: where the new copy cannot be made, filled, written to disk or renamed over the old one, the old copy stays, exit 190, with the cause named (... leaving DEST as it is: it has other names, which a write in place would change; the new copy beside it failed: ...), and under-wbwithwithout -wb it would be written in placewhere the default would have; a FIFO, socket, device or link that cannot be replaced is a 213, as in 9.85. -cocarries a file's ACL on XFS as root on EL7 and EL8: there XFS lists an ACL to root under its own name (trusted.SGI_ACL_FILE,trusted.SGI_ACL_DEFAULT) as well assystem.posix_acl_*, and hpcp took that name for an xattr it cannot carry to a new file: on the beside route a hard-linked file with an ACL got a new file without it (9.85 too), and under-wbevery file with an ACL would have kept its old copy (190). Thesystem.*name carries it now.-co's carry-over no longer follows a link put at the new file's name (9.85 too): on the beside route (-wb, a file with other names, a sourcecpmakes anew), the old copy's owner, group, xattrs and mode were set on the temporary file by its name aftercpmade it, andchown,chmodandsetxattrfollow links: in a root run into a directory another user can write, a link (or a second name of another file) put there at that moment gave that other file the old copy's owner and mode. On Linux each step now goes through a descriptor of whatcpmade, which a link or a file with another name cannot replace: it is refused (exit 190, the old copy kept). Off Linux it still goes by name (see "Off Linux, a rewrite in place can be swapped for a link mid-run" in docs/limitations.md) (9.87: the beside route's new file is made and held by hpcp on Linux and macOS, and the entry is now "Where cp cannot write a file hpcp holds, a landing can be swapped for a link mid-run").- A named link the kernel refuses to follow is kept, as in 9.84: 9.85 resolved a link that
-dnames itself and gavecpthe resolved path, so the kernel'sfs.protected_symlinks(another user's link in a sticky world-writable directory such as/tmpis refused to the one who follows it) no longer applied, and a root run wrote through a link another user had planted. 9.86 asks the kernel first: a link it refuses is kept, exit 190,... is a link to TARGET, which cannot be followed (Permission denied), nothing written. This changes 9.85's behaviour for such a link (written through) back to 9.84's. A dangling link is kept, and a link in a loop replaced, as in 9.85. -rbw(--read_before_write,--read-before-write): before a rewrite in place, the source is read to its end; a source that fails on read leaves the old copy as it is (exit 190). It costs a second read of each rewritten file, and does nothing with-wb, which writes nothing in place.- A warning before a copy that may not fit: where the destination's free space (
statvfs'sf_bavail) is less than the source's allocated size, hpcp printsSpace warning: DIR has NB free, less than the NB that SRC needs, ...on stderr beforecp, saying whether the old copy can be lost, once per destination filesystem in a run, then tries, as GNUcptries and fails: nothing is refused, and the exit code is the copy's (a run whose copies fit after all exits 0). The run's warnings are repeated at its end. Only on ext2/3/4, XFS and tmpfs. Missed warnings, where the free space says too little (the copy is tried as ever): btrfs, ZFS and bcachefs (compression, shared blocks), NFS, SMB, Lustre and GPFS (pooled space), overlay (it hides what is below), and an XFS with the source on the same filesystem, wherecpmay clone it (GNUcp9 and later does by default; thecp8.x of EL7 and EL8 never does, so there a copy that cannot fit gets no warning either, then fails). A root run onto an ext filesystem that is full for users but not for root gets one needless warning.-enesis unchanged. - A rewrite costs what it cost in 9.84 again: 1,000 rewrites of 4 KiB files on the EL7 VM (2 vCPUs, nothing else running in it, the host busy; Python 3.6; four rounds each, the versions interleaved) took 2.79 to 3.39 s on ext4 against 9.85's 4.47 to 6.39 s and 9.84's 2.87 to 3.73 s, and 3.07 to 4.52 s on XFS against 3.75 to 7.62 s and 3.06 to 4.42 s. On a busy host (Docker, Python 3.14, XFS on NVMe, 32 threads, load about 20 to 80, default
-j), 5,000 rewrites took 0.51 to 1.05 s (median 0.63 s) against 9.85's 0.62 to 1.53 s (0.72 s) and 9.84's 0.46 to 0.77 s (0.54 s), six rounds; 20,000 took 1.22 to 2.47 s against 1.69 to 4.42 s and 1.09 to 2.63 s, three rounds.-wbcosts about what 9.85 cost: on the EL7 VM, in a later and busier hour, three rounds each, ext4 5.66 to 6.11 s against 9.85's 6.57 to 9.12 s (9.86's default 4.10 to 4.30 s), XFS 4.13 to 4.57 s against 4.42 to 5.12 s (3.58 to 4.74 s). Not measured on NFS. - Known: a source that fails part way through a rewrite costs the old copy (truncated first, then removed), exit 190, the source kept, as in 9.84;
-rbwor-wbkeep it (see docs/limitations.md). - Known: another program reading a file while it is rewritten in place sees it empty or partly written, as with plain
cpand in 9.84; 9.85 wrote beside and renamed, so readers saw the whole old or the whole new file.-wbgives them that whole-file view (see docs/limitations.md). - Known: while a file is rewritten in place, anyone who could read the old file can read the new content, because its mode, owner and label change only when
cpends, and a program that had it open keeps reading it: an existing 0644 file overwritten from a 0600 source is readable by others during the copy. As in 9.84 and plaincp; use-wbwhere that matters. - Known: a stop during a rewrite costs the old copy: Ctrl-C, SIGTERM or SIGHUP remove the torn file, SIGKILL or Ctrl-\ can leave it torn; the source is kept, as in 9.84;
-wbkeeps the old copy (see docs/limitations.md). - Known: a power cut during or soon after a rewrite outside a move can leave the file partial or empty, as in 9.84; a move fsyncs every landing, and
-wbeach new copy (see docs/limitations.md). - Known: on a nearly full disk a rewrite can lose the old copy when another writer takes the room
cpfreed (exit 190, the source kept); theSpace warningcomes first on ext2/3/4, XFS and tmpfs (see docs/limitations.md). - Known: the beside route never falls back to writing in place: a rewrite there whose new copy cannot be made, filled, written to disk or renamed keeps the old copy, exit 190 (a 0555 or sticky directory, a bind-mounted file, no room for a second copy,
-cometadata that cannot be given to a new file) (see docs/limitations.md). - Known: with
-wba rewrite takes its directory's default Lustre or GPFS layout, and none of the old file'schattrflags or project id (see docs/limitations.md). - Known: off Linux the landing of a rewrite in place can be swapped mid-run, as in 9.84; use
-wbthere for a root run into a tree others can write (see docs/limitations.md) (9.87: done on macOS, and for first copies and the beside route's new file; see above). - Planned for 9.87: (9.87: the hang after an early stop and the 3.14 traceback done; see above) what 9.85 planned for 9.86 (the rare hang after an early stop, worker error lines on the progress bar's line, a move's directory fsyncs, macOS
F_FULLFSYNC, overlapped fsyncs in a move, the 3.14 traceback on an early Ctrl-C, and the rest in the 9.85 section below), the race on a directory on the way, on a first copy's name and on the owner and mode a rerun sets on an identical file,-enescounting only what a copy will write, where now a rerun with nothing to copy onto a nearly full destination exits 228, andcp_supports_sparsekeeping only a real answer, where now acp --versionthat times out under heavy load sends that worker's rewrites tocpby name (see docs/limitations.md; 9.87: done, except the race on a directory on the way: moved to 9.88).
Upgrading to 9.85 from 9.84
Nothing needs doing to upgrade. What changed:
- A copy whose two sources landed in one file exits 213: a destination can take two names for one where no rule on names says so: an 8.3 alias on vfat (
a/longfilename.txtandb/LONGFI~1.TXT), or on a vfat mounted with a codepageiocharset, a legacy name that happens to be valid UTF-8 or ASCII. 9.84 checked this only before a move removed a source; a copy without-rmexited 0 with one content missing from the destination. After every copy, the move's backstop now looks for landings that are one file with another source's landing and printsDestination clash: copied SRC, but LANDING is one file with OTHER_LANDING (from OTHER_SRC): the destination took the names for onefor each of the two sources. A source whose landing is not there at all after a copy that reported no error (seen beside an 8.3 alias on vfat) is the same clash:Destination clash: copied SRC, but it is at none of its landings (LANDING). The landing is left as it is: it holds one of the two whole when they were copied one after the other (-s), and in a parallel copy, where bothcps can write the one file at once (each truncates it, then writes), it can hold a mix of the two (9.87 note: the README said "whole" since 9.85); the other content has no name of its own there, so rename one of the sources.-rmeis then skipped, as for any copy error. A move now keeps both such sources, where 9.84 kept only the one whose landing failed its own checks. It costs anlstatof each landing, and of a source only next to a link or a shared landing; nothing is read. Memory: 8 bytes for each landing, and 40 more while they are sorted, so a copy's peak is as 9.84's (122 MB for 200,000 files, 373 MB for a million). Time: about 0.3 s per 100,000 files on an idle local disk, and more under load: a cached 100,000-file rerun at load 110 took 1.32-1.73 s with 9.84 and 1.81-2.01 s with 9.85. A file that changed during the copy, or a destination file someone else changed, is not a clash, and the copy still exits 0 for those; a source whose copy failed keeps its ownCopy failederror; if its landing is also one file with another source's, that is said asDestination clash: SRC failed to copy, and LANDING is one file with ..., and the exit is 213. - The move's backstop runs in threads only where a stat waits: chunks of 1,024 entries are looked at in one thread while each takes under 20 us an entry, and in
-jthreads once one takes longer (network storage, a cold disk). On a local disk, 32 threads took 1.2 s per 100,000 files of a move against 0.72 s in one. On NFS mountedactimeo=0, 10,000 files took 6.4 s in one thread and 3.0 s in four. - A rerun onto vfat no longer copies every file dated before 1980 again: FAT keeps no earlier time, so such a file's landing never had its time. Where the source is from before 1980-01-01 and its landing at or after it, the skip check reads both files in full instead of copying; for those files only.
- A link to the destination, named or listed, is the destination:
printf 'outl\nb\n' | hpcp -sfl - -d out -rmewithoutl -> outprinted "Not removing" for each extra and copied the link in asout/outl, a link to its own directory. It is now left out as the destination itself is (Left out ...: a source that is the destination, or a link to it, is not copied or moved), asked by what the link leads to (a link into a directory that cannot be searched is copied as a link, as before), with the one-rme checked nothingnote; the same forhpcp outl b -d out. -rmeasks about extra links once a directory: an extra symlink islstated only in a directory that holds a file or link source, as an extra file already was; on NFS mountedactimeo=0that saves about 0.6 ms an extra link.- The license is package metadata as an SPDX expression: the wheel carries
License-Expression: GPL-3.0-or-later(setuptools 77 and later build it without the "License classifiers are deprecated" warning). pip 9.0.3, the pip of EL7 and EL8, installs and uninstalls it as before (checked on Python 3.6 with pip 9.0.3); it does not read that field, sopip3 show hpcpthere saysLicense: None. - Errors the main process prints keep their own lines in a log: with output redirected, an error printed right after the progress bar was glued to its last line, so
grep '^Destination clash'missed it; what stdout holds is now written first. Known: an error a worker prints (aCopy failedline, for instance) can still follow the progress bar on its line, as in 9.84 (not run; the same count was found on an earlier 9.85 commit), sogrep -c '^Copy failed'can count fewer than the errors (12 files that cannot be read gave 9 to 11 matching lines in 6 runs, 3 on Python 3.14 and 3 on 3.6);grep 'Copy failed'finds them all. Planned for 9.87 (see docs/limitations.md; 9.87: done). - A rewrite goes beside the old file and is renamed over it: (9.86: only with
-wb, and by default for a file with other names, one that cannot be opened for writing, or what is not a file; see above) a file that is already at the destination is copied to a hidden.hpcp_tmp_name in its directory and renamed over it once whole, so a source that fails on read (a bad sector, an NFS soft timeout: checked with a real EIO on EL7), a full disk or a stop leave the old copy as it was, exit 190. 9.84 truncated the old copy first and lost it. A first copy writes straight to its name, as before, and costs nothing more; a rewrite costs a new file and a rename where 9.84 truncated in place. Each new copy is written to disk (fsync) before it is renamed over the old one, so after a power cut the landing holds the old copy or the new one, never an empty file (on this route: the in-place routes below, and-co's known limitation, write over the old copy, and a power cut during that write can leave the file partial); an fsync the filesystem fails is aCopy failed(190) with the old copy kept, and a filesystem that cannot fsync at all (some FUSE ones: EINVAL, ENOTSUP, ENOSYS) is written as before. Measured against 9.84 (1,000 4 KiB rewrites on an idle EL7 VM, three runs each): ext4 4.75 to 5.05 s against 5.84 to 6.58 s, XFS 4.52 to 4.74 s against 5.31 to 6.03 s, about 1 to 1.5 ms more per file, nearly all of it the fsync (without it the rename alone cost about 0.1 ms); on a heavily loaded host (XFS on NVMe, 3,000 rewrites, 8 workers, median of six) 3.7 s against 9.1 s, of which the fsync 2.6 s; over NFS loopback mountedactimeo=0from asyncexport 18.6 to 20.6 s against 21.8 to 23.0 s, the fsync adding nothing (the server commits each write already), the create and rename the rest. A first copy writes straight to its name and is not fsynced (outside a move, below): nothing was there to keep. What a new inode changes: a process holding the old file keeps reading it; an NFS client holding it open may getESTALE, and where the copying client holds it open itself, its NFS client keeps the old one as.nfsXXXXuntil it is closed, which-rmethen sees as an extra; inotify watchers see the name replaced (moved to), not written; settings a filesystem keeps on the inode and not in a portable xattr are not carried (a Lustre or GPFS layout set withlfs setstripeon the file,chattrflags such as+C, a project id: the new file takes its directory's); and a rewrite costs that fsync, as above. A staleuser.*xattr or ACL of the old copy no longer survives a rewrite. - Written in place only when the source has just read whole: (9.86: gone; a rewrite goes in place by default, and the beside route never falls back; see above) where a new name cannot be made or renamed (a 0555 directory with a writable file, a sticky directory, a bind-mounted file), a regular file with one name is written in place, as 9.84 did, once the source has been read to its end, and only when the old copy is at least the source's size (written over it, below) or the free space holds the source. Otherwise the old copy stays, exit 190 (
Copy failed: cannot copy SRC to DEST, leaving DEST as it is: WHY). This includes a rewrite that grows a file on a nearly full disk whose new name ran out of room: 9.84 grew it in place, when the growth fitted. A write in place is not atomic and is not fsynced (outside a move, below): a power cut during it can leave the file partial, as in 9.84. - A rewrite in place writes over the old copy: (9.86: gone;
cpwrites the file, as in 9.84; see above) a file of the same size or smaller that is written in place (the fallback above) is now written over the old copy and then cut to its length. 9.84 hadcptruncate it first, which freed its room: on a nearly full disk another writer (in 9.85, another worker's temporary file beside its own landing) could take that room, the write ran short, and the old copy was lost (exit 190). Only the source's data is written; where the source has a hole, the old copy's data there is punched to a hole, so the result is as sparse as the source, ascpmakes it (where the filesystem cannot punch, zeros are written over that data instead). Over a dense old copy the rewrite needs no room on ext4 or XFS. Over a sparse one, the room for the source's data that lands in the old copy's holes is reserved first (fallocate, over those holes only), before anything is written: without that room the old copy stays as it was, exit 190 (... leaving DEST as it is: no room for the source's data where the old copy has holes), where 9.84 freed the old copy first and could succeed. A reservation that falls short, or is stopped, gives back the room it had taken (the holes are punched again), where the filesystem punches. A sparse old copy on a filesystem that shows no holes (NFS before 4.2) goes tocp, as in 9.84, which keeps the holes. On a filesystem that copies on write (btrfs, ZFS, bcachefs), where writing over the old copy needs room for all of it (on a nearly full btrfs that tore the old copy, wherecpwrote the file whole), the rewrite goes tocpas in 9.84, which frees the old copy first (or clones a source on the same filesystem), so there another writer can still take that room and the old copy can still be lost, as in 9.84. An XFS file whose extents a reflink shares also needs room for the overwrite, and on a nearly full disk can still lose the old copy: as in 9.84 with coreutils before 9.0, while with coreutils 9.0 or later and the source on the same filesystem 9.84'scpcloned it and needed no room. Both planned for 9.86 (see docs/limitations.md). - Known: a SIGKILL or Ctrl-\ (SIGQUIT) during a rewrite leaves a hidden
.hpcp_tmp_file beside the file it was rewriting (9.86: on the beside route only; see above) (the file itself untouched);-rmewith a directory source removes it as an extra (see docs/limitations.md). - Known: a growing rewrite whose temporary file runs out of room (a full disk, a quota) exits 190 and keeps the old copy (9.86: on the beside route only, part of "the beside route never falls back"; see above), where 9.84 wrote it in place (see docs/limitations.md).
- Known: with
-co, a file whose owner, group or an xattr cannot be carried to a new file is written in place after the source reads whole (9.86: by default-cowrites a file with one name in place, which keeps all of it; on the beside route such a file keeps its old copy, 190; see above), so a destination failure part way can tear it (see docs/limitations.md). - Known: a sparse rewrite in place without room for the data that lands in the old copy's holes exits 190 and keeps the old copy (9.86: gone with the write-over; see above), where 9.84 freed it first and sometimes finished, sometimes lost it (see docs/limitations.md).
- Known: on Windows nothing is fsynced, as in 9.84 (see docs/limitations.md).
- Known: a move's links made in another user's directory the runner may not read are not fsynced (see docs/limitations.md).
- Planned for 9.86: an option to write in place instead of beside (9.86: done the other way round: in place is the default, and
-wbwrites beside; see above), for a per-file Lustre or GPFS layout and readers on other NFS clients (see docs/limitations.md). - Planned for 9.87: on Python 3.6 and 3.14, a run stopped early (Ctrl-C, SIGTERM) or whose copy worker dies can rarely hang (9.87: done, the dropped stop and the 3.14 traceback too; see above) (9 in 3300 probe runs, about 1 in 75 early Ctrl-Cs on EL8, about as often as 9.84); a second Ctrl-C does nothing then, Ctrl-\ or
kill -9ends it (leaving a.hpcp_tmp_file where a rewrite was under way, as SIGKILL does), and nothing is removed. Also planned: a stop whoseKeyboardInterruptPython drops in the parent (rare) is not acted on there: during the copy it ends with exit 191 (BrokenProcessPool) instead of 130 (seen on 3.14), and outside a pool the run goes on to its end; and on 3.14 about one early Ctrl-C in three prints a traceback (see docs/limitations.md). - A move writes each copy to disk before a source goes: the worker that copies a file fsyncs the landing before it reports the file copied (a landing an earlier run left, the same size and time, is fsynced too), so a power cut after the move cannot lose both the copy, still in memory, and the source, whose removal was already on disk. 9.84 removed sources with the copies unsynced. A landing the filesystem fails to write is a failed copy: its own error line (
Copy failed: ERROR copying SRC to DEST, ...: DEST cannot be written to disk (Input/output error)), the landing is removed so that a rerun writes it again, and the move'sRemove skipped: ... the copy reported N error(s)follows, so no source is removed (checked on EL7 and EL8 with a thin volume out of space, XFS and ext4: 150 MiB moved onto 64 MiB of real space kept its source). Why an fsync of each copy, and not one syncfs(2) of each destination filesystem at the end (what the first build did): before Linux 5.8 syncfs reports no write error at all (EL7 runs 3.10 and EL8 4.18: on that thin volume syncfs returned 0 where an fsync of the same file returned EIO, and the move removed its source); a writeback error is kept only on the in-memory inode, and in a long move the kernel writes early landings back on its own long before any check at the end, an inode evicted under the copy's own memory pressure taking its error with it, whereas an fsync right after the copy, while the data is still dirty and the worker's own descriptor holds the inode, cannot miss it (the loss was reproduced on EL8, kernel 4.18, XFS and ext4: after a writeback error anddrop_caches, a fresh open's fsync returned OK on a copy that did not match its source; on EL7, kernel 3.10, the error surviveddrop_cachesin that setup, so there it was not shown, and the design does not depend on it); and the destination root's filesystem is not every filesystem the copies land on (a mount below it). On ext4 and XFS the fsync of a new file also commits the transaction that made its name and every earlier one (the directories made for it), so no directory is fsynced (ext4:jbd2_complete_transactionup to the inode'si_sync_tid; XFS: a log force up to the latest LSN that touched the inode;fsync(2)itself promises the name only with a directory fsync, so other filesystems may differ). It works whereveros.fsyncdoes, off Linux too (not on Windows, where nothing is fsynced). On macOSfsyncreturns once the data is in the drive's own write cache, and onlyfcntl(F_FULLFSYNC)flushes that, so a move there can still lose both copy and source to a power cut: planned for 9.87 (see docs/limitations.md; 9.87: done, see above); this is from reading Apple's documentation, not a run (there is no Mac here). On Lustre an fsync is sent on as an OST sync: from reading the Lustre client's code, not a run. A filesystem that cannot fsync at all (some FUSE ones: EINVAL, ENOTSUP, ENOSYS) is written as before. A file whose mode lets its owner neither read nor write it (a copy of another user's file of mode 0044, owned by the non-root runner) is given owner read for the open and its exact mode put back through the descriptor at once. Each directory a move makes a link in is fsynced too, once all its links are made (a link has no data to fsync, and links are made after every file; on ext4 and XFS that fsync also commits the directories made before it); another user's directory the runner may not read is passed over. That costs nothing that showed: 20 directories, each holding one file and 100 links to it (2,000 links) moved in 0.57 to 0.77 s on EL7 ext4 against 0.58 to 0.74 s without it, 0.69 to 0.87 s on EL7 XFS against 0.63 to 0.81 s, 0.61 to 0.72 s on EL8 ext4 against 0.59 to 0.69 s, and 0.57 to 0.76 s on EL8 XFS against 0.67 to 0.78 s (3 runs each, interleaved; the hosts were busy, so only the comparison holds). Not fsynced yet (planned for 9.87, see docs/limitations.md; 9.87: done, see above): a move's empty directories, and a directory's mode, owner or times, where no file or link lands on that filesystem after the directory is made; after a power cut within the journal interval, a moved empty directory, or such a directory's mode, owner or times, can be missing at the destination while the source is already gone. Not fsynced: a block device named by-d, onto which a move writes and then keeps every source (213: the device is another kind of entry than the file). A-diimage is covered: the fsync of a file in the mounted image is flushed down to the image file by the loop driver. What it costs, against the same code without the sync (an fsync of each file is a wait for the disk; the worker count does not hide it where the disk is slow): on an idle EL7 VM (2 vCPUs), 10,000 4 KiB files moved took 79 to 92 s on ext4 against 47 to 54 s, and 72 to 82 s on XFS against 43 to 47 s (1.6 to 1.9 times, about 3 ms a file); beside a 3 GiB writer 86 to 110 s against 48 to 63 s (ext4) and 92 to 101 s against 51 to 56 s (XFS); 4 files of 256 MiB came out alike (1.1 to 3.6 s against 1.3 to 4.9 s, writer or not); on a host's XFS on NVMe (Docker) 4.5 to 5.4 s against 4.3 to 4.8 s quiet and 7.3 to 13.1 s against 4.7 to 8.6 s beside the writer. A move with many small files onto a slow disk takes longer for its safety, and a higher-joverlaps the fsync waits (planned for 9.87 in the worker itself, see docs/limitations.md; 9.87: a move's default is at least 16 workers, see above): the default is one worker per CPU (2 on the EL7 VM, 4 on the EL8 VM), and 2,000 files of 4 KiB moved with the default against-j 16took 18.6 to 22.9 s against 10.3 to 11.7 s (EL7 ext4), 17.9 to 21.2 s against 10.1 to 11.7 s (EL7 XFS), 11.9 to 14.0 s against 9.3 to 11.8 s (EL8 ext4) and 14.2 to 15.8 s against 8.2 to 10.5 s (EL8 XFS), 3 runs each. That the gain is overlapped waits, and not CPU, is an inference (the VMs have 2 and 4 vCPUs, far fewer than 16 workers). - What is at a landing is never opened or written through: a FIFO, socket, device node or symlink below a destination is replaced by the file the source has there: 9.84 hung on a lone FIFO, wrote the file into the disk behind a device node (checked on EL7), and wrote through a link. One that cannot be replaced (its directory refuses) is a 213 that names the directory and the fix, never written through (9.86: on Linux the file a rewrite writes in place cannot be swapped during the run either; a directory on the way still can, deferred). A FIFO or device named by
-dis still written through, ascpwrites it (a pipe feed, an image written to a disk), and a link named by-dis followed. - A symlink inside a destination is replaced by what the source has there (a file or a directory), with a note naming it; name it with
-dto write through it:out/d -> ../elsewherebecomes a directoryout/d, and nothing is written to../elsewhereor changes its mode (Note: out/d was a link to ../elsewhere and is now a directory; nothing was written to ../elsewhere. To write through a link, name it as the destination: hpcp src/d/ -d out/d/). 9.80 to 9.84 wrote src/d's files into elsewhere, and a user who could write the destination could steer a root restore into/etc. A symlinked data directory that a rerun wrote through now gets a real directory, on the destination's own disk. Under-ncdsuch a link is not replaced: a 213 for each file below it, naming the-dform. A link that cannot be removed (its directory refuses) is a 213 for each file below it. - No more refusals for a destination directory that cannot be listed: 9.81 to 9.84 read each landing directory for links before the copy, on one worker, and refused (213,
chmod u+rx) a directory it could not read; nothing below a destination is followed now, so nothing can hide there, andchmod 000 outtakes the copy again, as it did in 9.80. A landing through a link to a source is no longer refused either: the link is replaced. -cokeeps what was there on a new file: (9.86: on the beside route only; by default-cowrites in place, which keeps all of it; see above) the rewrite goes beside too, and the new file gets the old one's owner, group, mode,user.*xattrs, POSIX ACLs, SELinux label and FAT attribute bits; a group or a directory's default ACL the new file would take is not kept. As a write in place does, it drops a file capability (security.capability), and for a non-root owner set-user-ID, and set-group-ID with group-execute. Where those cannot be carried (another user's file, a group the runner cannot give, an xattr hpcp cannot carry such astrusted.*) a file with one name is written in place as 9.84 did, after the source has read whole; one with other names still gets a new file, which the runner owns, so the other names keep the old content. Otherwise the inode changes, as above.- A block device named by
-dthat is in use is refused (exit 213):hpcp img -d /dev/sdb1with sdb1 mounted, used as swap, or held by device-mapper, md or LVM saysis in useand writes nothing: hpcp first opens itO_EXCL, which Linux refuses then (a mounted loop device checked on EL7), and holds it untilcpis done, so no mount can start meanwhile. A plain open by another program (addwriting it) is not seen. 9.84 wrote over it, ascpdoes. - SIGTERM and SIGHUP clean up as Ctrl-C does, then end by that signal: in the main process and in every worker, a stop stops
cp, removes the temporary file and, for an image, its mounts and loop devices; the run then ends by the same signal, sotimeout, a shell and systemd see what they sent (Ctrl-C keeps exit 130). A signal the run was started ignoring stays ignored:nohup hpcp ... &keeps going on a hangup. A worker whose main process dies (SIGKILL) stops itscpand cleans up within about 4 s, under Python 3.14's forkserver too. hpcp uses SIGUSR2 for this; a SIGUSR2 sent to a worker stops it. Only SIGKILL of a worker, or of a serial run, can leave a.hpcp_tmp_file. - A FIFO, socket or device named as a source is copied, exit 0:
hpcp a/p -d out/made the node and exited 200 (Source path type error), and-rfkept every source (212); it is copied ascp -acopies it, and moved with-rf. One met in a directory tree is still skipped with a note. A list made byfindtherefore copies its FIFOs and sockets, where the same tree named as a directory skips them. - A move of a link and a path through it moves both:
printf 'lb/\n' | hpcp -sfl - lb/x -d out/ -rfandhpcp lb lb/d/ -d out/ -rf, withlb -> b, exited 192 at random and never removedb/x(b/d); exit 0 now, and the named paths go. A path listed through a link that another source of the run copies as a link (hpcp lb -sfl listwithlb/xin the list) is a 213 for that path, the link copied. - A copy into its own inside under another spelling (FUSE exFAT):
hpcp D/ -d d/sub/there added a nested copy on every run; the destination is now left out of the walk, as for one spelling, and a pair the directory cannot be asked about is refused (241). - A pair of names that fold alike near PATH_MAX is copied: the probe makes its names relative to directory descriptors, so a landing within about 57 characters of the path limit is no longer a false 213 (
File name too long). - The check before a copy costs the garbage collector nothing per entry: about 1 to 2 s less per million entries of a list.
- Known, for 9.87: hints with a name the locale cannot show cannot be pasted into a shell: (9.87: done, see above) with any non-ASCII name under LANG unset, or a non-UTF-8 one under a UTF-8 locale, the replaced-link Note and the
-ncdhint print the name with Python's escapes (d\udcc3\udca9), not shell-quoted (deferred, see docs/limitations.md). - Known, for 9.87: with LANG unset, a
-siffapply stops at the first non-ASCII name: (9.87: done, see above) under Python 3.6 on EL7 with no locale (cron, some ssh sessions), the patch apply reads its lists' names as UTF-8 and stops with a UnicodeEncodeError; 9.84 does the same. Run the-siffapply withLANG=en_US.UTF-8(the locale must be installed:locale -alistsen_US.utf8); making the patch (-diff) and-dfllists are not affected (deferred, see docs/limitations.md).
Upgrading to 9.84 from 9.83
Nothing needs doing to upgrade. What changed:
- A move keeps a source that its landing does not hold (exit 213): before a move removes a source file or link, one of its landings must hold it: there, of its kind (a symlink at a file's landing counts as what it leads to, since the copy writes through it; since 9.85 only a symlink named with
-d, as one below a destination is replaced), of its size and, unless-co, of its modification time or else of its contents; not the source itself; and not one file with another source's landing, unless that file has other names (a destination deduplicated by hard links: the copy never writes such a file, it replaces it). A destination can take two names for one where no rule on names says so, and the second source is then written onto the first one's landing: an 8.3 alias on vfat (a/longfilename.txtandb/LONGFI~1.TXT), and on a vfat mounted with a codepageiocharset, a legacy name that happens to be valid UTF-8 (cp1251C3 A9 74againstE3 A9 74, KOI8-RбёagainstбЁ) or ASCII against a legacy one (istanbulagainst ISO 8859-9İstanbul). 9.83 exited 0 with one content gone, and a rename between two such names (hpcp out/ONE -d out/OTHER -rf) lost the file. Each such source now stays, withDestination clash: not removing SRC: WHY, and the rest of the move goes on; checked on vfat on EL8. It costs anlstatof each source and of each landing before the removal, run in parallel; a file and its landing are read only where their times disagree, such as a file from before 1980 on vfat, which keeps no earlier time. A rename within one directory asks that directory, the source's, whether the two names are one, by making them in a hidden.hpcp-case-probe-...directory there, as the copy does in a destination; akill -9in that moment can leave it behind. A copy without a move removes nothing and is not checked: there such a pair still exits 0 with one landing holding the other's content, both sources kept (deferred, see docs/limitations.md). - Modification times agree within one step of the filesystem that kept them: times are compared as whole nanoseconds, within one step of the coarser of the two (2 s on vfat, 10 ms on exFAT, 1 us on UDF, 100 ns on NTFS) and never closer than one step of a float second (238 ns today), since a time set through float seconds, as many Python tools set it, lands within half of that. 9.83 compared float seconds and guessed the step from the float, which near today's times shows no step finer than 1 s; 9.84 before this fix kept about 400 of 2000 sources in a move onto ntfs-3g and 1750 onto UDF, 213. The same rule serves the move's check, the skip check and stored states (
-dfl), and a file found identical gets its times again to the nanosecond, where 9.83 set them through float seconds. -rmewith a source that lands in a directory of its name judges only that directory:hpcp b -d out/ -rmelands inout/b, and no longer removesout/keep;hpcp a/x b -d out/ -rmethe same.hpcp src/ -d out/ -rmestill judges all ofout/, and a list is judged as before. What else is inout/is no longer judged at all: a script that counted on it to leaveout/holding onlybnow has to remove the rest itself.-rmenever removes a source, or what lies in or holds one: asked by identity, whatever the destination calls it, and a list entry left where it is inside the destination (Skipped 1 list entries inside the destination) is a source too.hpcp out/sub/ b/ -d out/ -rme, answered y, deletedout/sub/x, the only copy whereb/xreplaced it atout/x. It stays now, with a note. A link in the destination is judged as a link, as in 9.83:out/d -> ../src/dis an extra and goes. A list that names the destination itself (printf 'out\nb\n' | hpcp -sfl - -d out -rme) now checks nothing, with-rme checked nothing, as the same sources given as arguments always did; 9.83 removed the extras belowout/b. It asks once a directory, not once an extra: on NFS mountedactimeo=0it takes 0.32 s for 10,000 extras, where the walk that finds them takes 0.94 s and 9.84 before this fix took 114 s.
Upgrading to 9.83 from 9.82
Nothing needs doing to upgrade. What changed:
- A named source that is not there is reported, and counts as an error (exit 207):
hpcp nosuch ok/g -d out/copiedok/gand exited 0 without a word; a pattern that matches nothing (hpcp *.log *.txt -d out/with no log) did the same. It now saysSource path not found, copies the rest and exits 207. A name under a directory that cannot be searched sayscannot be reachedinstead ofdoes not exist, since nobody could look. Alone it is still exit 240, and it now says which. A name whose glob characters match nothing as a pattern (hpcp 'a[1]' -d out/, with a file of that name) is that file. The last word with no-dis the destination, which need not exist, andhpcp nosuch ok/g, which leaves only that, is exit 240 (9.82: 70, a traceback). - A source named as an argument that is not there stops a move and
-rme: the usual rule on errors applies, sohpcp nosuch ok/g -d out/ -rfcopiesok/g, removes nothing and exits 212.hpcp typo/ d/ -d out/ -rmeremoves nothing either, where whattypoholds at the destination looked extra. A list is older than the tree it names, so an entry that is gone stops-rmebut not a move:printf 'nosuch\nok/g\n' | hpcp -d out/ -rfsays so, movesok/gand exits 207, as in 9.82. A removal with no destination goes on past a missing name, asrmdoes, and exits 207. So does the comparison a stored list runs:hpcp typo ok -fl S -rmesays so and cleansokby the list, exit 207, as it has one source left. A name excluded with-ethat is not there counts for nothing:hpcp nosuch ok/g -d out/ -rf -e nosuchmovesok/gand exits 0. When the prompt with no-dturns the last word down as the destination, that word is a source like the others. - Two names the destination takes for one are a clash (exit 213): with
a/Xandb/x,hpcp a/ b/ -d out/ -rfonto a directory that folds case (ext4 or f2fs casefold, vfat, exFAT, and NTFS mountedignore_casewith lowntfs-3g on Debian 12, EL7 and EL8, each run; SMB should behave the same, not run) exited 0 with one file's content gone. The first stays, by source order and then by name; the other is reported and not copied, directory sources and one tree too, and a move removes nothing. Directories that differ only in case merge, as they will there, except on a vfat mounted withiocharset=utf8given explicitly: there the second directory's files are not copied (Directory sync error, exit 193, or 212 in a move, which keeps the sources), nothing lost, as in 9.82 (a known limitation, see docs/limitations.md). Each filesystem folds by rules of its own (StraßeandSTRASSEare two names on vfat and one on ext4), so nothing is assumed: hpcp folds every name in memory, and only where names collide does it make each of their spellings in turn in a hidden directory (.hpcp-case-probe-...) in the directory they land in, see which ones the directory takes for one name, and remove it, restoring that directory's times: an owner's directory keeps them, but one that a group member writes gets a new modification time. One such question covers every spelling of a name there, however many: names in a legacy encoding such as CP1251, which collide in memory by their length, digits and punctuation such as.and-, cost one question per directory and such group, not one per pair. A run with no such pair writes nothing extra. A directory that cannot be asked (nothing can be made there, such as a mode 555 directory or a read-only mount, and at least one name is new) gets a 213 that says so and what fixes that, even where the two would have been two names; where both names are already listed, they are two names and the run goes on. A directory that refuses one of the names (a vfat whose charset lacks a character) gets a 213 that says the directory refuses that name. Whether two names are one is always asked by making them, never read from file numbers: exFAT through FUSE (EL7, EL8) gives each spelling of one file a number of its own. Names that are not UTF-8 (CP1251, KOI8-R, Latin-1 or ISO 8859-9 on a vfat or exFAT mounted with thatiocharset) are asked about too: every letter of such a name, ASCII ones too, every byte past ASCII, and the ASCII punctuation that can end a double-byte character (@ [ \ ] ^ _ ` { | } ~) may be another's case (the kernel's ISO 8859-9, ISO 8859-3 and CP857 tables makeithe other case ofİ; on exFAT mounted CP932,xа.txtandxА.txtare 84 70 and 84 40), soПётрandпётр,Вікторandвікторin CP1251,iş.txtandİş.txtin ISO 8859-9, andωandΩin Big5 (CP950), meet. So dokız.txtandKIZ.TXT: a UTF-8 vfat with codepage 850 or 857 gives the first the short name of the second. Some pairs are still missed (a known limitation, see docs/limitations.md), all on a vfat or exFAT mounted with a codepageiocharset: a name whose bytes happen to be valid UTF-8 against its other case, whether that one's bytes are UTF-8 too or not (C3 A9 74, Latin-1ét, againstE3 A9 74, which a cp1251 mount reads asГ©tandг©t; KOI8-RбёandбЁ), an ASCII name against a legacy one (istanbuland ISO 8859-9İstanbul), and two cases of different lengths (EUC-JPς, three bytes, againstΣ, two). Akill -9in that moment can leave the hidden directory behind; other signals wait for it to go. With several-d, two files that one destination takes for one name are refused for all of them, and so are a file and a directory of another source that one destination takes for one name: either may land there. In 9.82 such a file and directory with-ndsand-rdsexited 0 with one content gone in about a third of runs:-ndsmakes the directory only as a file below it is copied, and the file was written into it. A symlink at the destination in another case is the same name too:out/X -> ../src/ywithsrc/xis 213, as in one case.-diimages are asked as well. What each filesystem takes for one name was found by asking it: on NTFSXandx, andÉandé, are one name, whileStraßeandSTRASSE,écomposed and decomposed, and a zero-width joiner are not; on vfat and on the exFAT of the Linux kernel (Debian 12) a trailing dot goes (a.isa,d./fisd/f), while exFAT through FUSE (exfat-fuse 1.3.0, as EL7 and EL8 have it), NTFS and ext4 and f2fs casefold keep it (a.andaare two names); a trailing space stays on exFAT and NTFS, and vfat refuses a name that ends in one. Names are read as UTF-8 whatever the locale, so Python 3.6 under the C locale (EL7 with no locale set, or cron) catchesÉandétoo, where 9.82 lost one file's content in a move. - A move that renames a file in case only is refused (exit 241):
hpcp X -d x -rf, andhpcp d/X -d d/x -rf, on a directory that folds case, is a move onto itself, ashpcp X -d X -rfalways was. 9.82 and earlier exited 0 and the file was gone. On a directory that keeps both names it is a rename, as before. - The refusal holds on a rerun:
a/D/fandb/d/fonto a folding destination are 213 on every run, not only the first, andD/fkeeps the content ofa/. Onceout/Dexists the two landings look like one directory, which is an overlay for a directory of one spelling (the later source wins); here they are two names, so it stays a clash. One tree witha/D/fanda/d/fonto an existingout/Dis 213 too, where 9.82 dropped one without a word. -rmeleaves what the copy wrote under another spelling: on a folding destinationa/xwrites into an existingout/X, andXlooked extra: with-rme -rfthe file was gone from both sides, exit 0. The same held for files of directories that merged (a/D/f,b/d/g) and after a rename in case only. A name the listing does not show is now asked about by what it is; the file keeps the spelling that was there first. A directory the source spells in another case is not announced as extra and is not removed when it is empty.Copy failedsays why: a command that fails now carries the last lines of what it printed, so a full disk saysNo space left on deviceinstead of onlyreturn code 1.- A destination that cannot be made is left out, not a traceback: a
-dwhose directory cannot be made (no permission, a read-only or full filesystem, a file in its path, or a name the filesystem refuses, such asx.on exFAT mountediocharset=cp1251) stopped 9.82 with a traceback, exit 70, whatever the other destinations. It is nowDirectory sync error: cannot make DEST (reason), ignoring it, and the run goes on with the others, exit 193: a copy copies to them, and a move moves everything to them and removes the sources, where 9.82 moved nothing. Where none is left, it isNo valid destination(202), and nothing is copied or removed. -ndswith a directory meeting a file is a clash (exit 213): 9.82 ended in a traceback, exit 70. A directory it cannot make isDirectory sync error(193), as without-nds.- A rerun with a source that became unreadable is a clean
Copy failed(exit 190): 9.82 saidCopy process crashed(191). The old copy stays, and a move ends 212 as before. A destination that cannot be read is no longer a crash either: it is copied again. - A landing through a link into an unreachable place names the link: with
out/l -> /root/secret/fthe 213 says what the link leads to and offersrm out/l; 9.82 said only that/rootcannot be searched, with achmoda user cannot run. The refusal itself is the same. (Since 9.85 such a link is replaced, with a note, and nothing is refused.) - A named FIFO, socket or device that is refused is reported once:
hpcp a/p b/p -d out/no longer addsSource path type errorforb/pafter its clash.
Upgrading to 9.82 from 9.81
- Labels with trailing spaces on btrfs and NTFS are kept: these two labels now come from the filesystem's own tool (
btrfs filesystem label,ntfslabel), which gives them whole; 9.81 took them from libblkid, which drops trailing spaces, so a-ddcopy lost them. Other filesystems still lose them. A disk patch made by 9.81 or older recorded such a label without its spaces, so regenerate those patches. - hpcp no longer calls sync(2) (which writes every filesystem on the host); it fsyncs the loop device and image it wrote, and a patch applied to a filesystem that is mounted already (a disk patch to a live disk, or
-siffonto a directory of one) ends with syncfs(2) on that one filesystem, so the patch is on disk when hpcp exits. A plain copy ends ascpdoes, with nothing flushed. unshareis now needed for xfs geometry on EL7:xfs_infothere takes only a mounted filesystem, so hpcp mounts the source in a mount namespace of its own. Withoutunsharea-ddcopy of xfs gives up mirroring the geometry and uses the defaults, and says so.-conever reads a FIFO, socket or device node: a source that is not a regular file is made ascp -amakes it, with its mode, owner and times, and never opened. 9.81 read a device to its end and wrote it through what was at the destination, another disk if a device node was there, and a FIFO source hung on the first run. As in a plain run, a user who may not make device nodes gets an error for a device source (9.81 under-cogot an ordinary file with its contents). The old file at the destination now stays:cp -atakes the name away before itsmknodfails, so a plain run deleted it (9.81 under-coemptied it). hpcp asks first, by making a node of that kind beside the destination under a name of its own and removing it, and copies nothing when the system refuses.- A device named by
-dis never replaced (exit 213): a source that would take the name of a device node that-dnames itself (hpcp /dev/sda -d /dev/sdb,hpcp a/fifo -d /dev/sdb, with or without-co; a regular file too when the node has other names) is a clash: the node stays, and the message says what fixes it (-ddclones a disk; remove the node to replace it). A plain run replaced the node. A link to a disk (/dev/disk/by-id/...,/dev/mapper/...) is the disk, and is kept as well. The check is per destination: with several-d(spill-over, each file lands on one) the file lands on the others with a note, and the run ends as any other run of that source (a move completes); it is a clash, exit 213, and nothing is copied only when no destination is left. A landing on a name that any-dgives counts (-d out/ -d out/n), not only the name a-dspells out. A node for the same device as the source (the pair a first run made, or the same device under another name) is no clash. A symlink source runs nocpand keeps its 9.81 result (exit 162, the node untouched). A device node inside a destination directory is a file of the tree, and a node source replaces it. A regular file still writes through a device node, as in 9.81 (see docs/limitations.md). - xxhash is no longer installed on Python 3.6:
pip3 install hpcpon stock EL7 and EL8 failed without a compiler, because pip 9 takes no xxhash wheel and hpcp required it. It now installs there and hashes with blake2b; an xxhash already installed is still used. To add it, upgrade pip first (pip3 install -U pip, thenpip3 install xxhash): on stock pip 9.0.3pip3 install xxhashfails on EL7 and EL8. - multiCMD: the embedded multiCMD is 1.57. It runs whenever the installed one is older, so nothing needs upgrading. With multiCMD 1.57 or earlier installed, pip 9 (stock on EL7 and EL8) without
--userstopspip3 install -U hpcpwithconfigparser.DuplicateOptionErroronce a newer multiCMD is out, because it upgrades dependencies too: usepip3 install hpcp==9.82,pip3 install -U --no-deps hpcp, or runpip3 install -U piponce. With--userit does not stop. (Until 9.88: from 9.89 hpcp requires no multiCMD, so pip, pip 9 included, leaves an installed one as it is; see Upgrading to 9.89.)
Upgrading to 9.81 from 9.80
- Lists keep their tree (layout change): a path from a list (
-sfl FILE,-sfl -, or stdin when no source is given) now lands at<dest>/<path as given>, normalised, without a leading/,./or any.., asrsync --files-fromandcp --parentsdo. 9.80 put every entry flat in the destination, sosrc/a/x.txtandsrc/b/x.txtoverwrote each other. Scripts that rely on the flat layout have to change:cdinto the directory that holds the files, or pass the paths as arguments, which keep their layout. See Copying from a list. - Same-name clashes are errors (exit 213): when a file named directly (an argument:
hpcp a/x b/x -d out, or a list entry) and another source land on one destination file, nothing is overwritten silently any more. The first in order stays, the rest of the run is copied, the clash is named, and hpcp exits 213, ascprefuses such a copy. It counts even when the contents are the same. A file named directly against a file from a directory is a clash too. A move (-rm) or-rmethat meets a clash removes nothing. - A file against a directory is a clash too (exit 213), in 9.80 as well: when a file lands where a directory is (one already in the destination, one that another source makes, or one a listed path implies:
d/xwithd/x/y), the directory stays, the file is not copied and its source is not removed, and the rest of the run is copied. 9.80 put the file inside the directory (out/x/x), andhpcp a/ -d out -rme -rfthen removed it as extra and removed the source. A directory onto a file (or onto a link to one) leaves that file as it is, with its mode and owner, and is reported the same way (9.80 changed the file's mode, and as root its owner, then failed with exit 193). A symlink source that is a directory is as before. A symlink onto a directory that is not its own name, named directly, lands inside it like a file (hpcp lf dgivesd/lf, exit 0; 9.80 exited 162), and that changes two old results:hpcp lf -d lnd, withlnda link to a directory, used to replace the linklndand now givesd/lf;hpcp a/x -d la, withlaa link to the file's own directory, used to replace the link and now exits 0 and changes nothing. A link to a directory given with-rmeis still refused (exit 212). A file named directly onto an existing directory still lands inside it (hpcp a/x dgivesd/x, in every mode, as in 9.80); only ad/xthat is itself a directory is the clash. - A file that would land on a source file is refused (exit 213), 9.80 as well: hpcp works out, on real paths and file by file, where each file lands, and refuses the whole run before anything changes when a file would land on a source file (its own too, in a move), unless, in a copy, that file belongs to a directory that lands on itself, which reads and writes nothing. It names both paths.
cprewrites a file in place, so anothercpreading it gets nothing or a part, and a move then removes the path that held the other content: 9.80 could leave an empty file, both contents gone, the sources removed, exit 0. Examples, each with a file at both places:hpcp p/q/ -d p/withp/q/xandp/q/q/x(one source over its own tree),hpcp d1 d2/d1/ -d d2/,hpcp a out/a/s -d out/, andprintf '../../c/r\nr\n' | hpcp -d .. -rfrun inw/D/c. A link changes nothing, and neither does a bind mount of the destination or another case of its name on a casefolded filesystem:hpcp d1 l2/d1/ -d d2/, withl2a link tod2, is the same run, and so is a landing that a link in the destination sends onto a source (hpcp src/ -d out/without/e -> ../src/d, or acpthat would write throughout/x -> ../a/x). What runs: a landing on a path where no source has a file, inside a source's tree too (hpcp p/q/ -d p/with onlyp/q/q/only); a directory that lands on itself, which another source updates as it would any destination (hpcp */conf -d merged/, every run;hpcp a/ out/sub -d out/). A file named directly that lands on itself is not given up that way:hpcp x y/x -d ./is refused. Only what is really copied counts: a path left out by-eand a special file land nowhere.-doand-dido not look. A move onto itself or into itself, as a whole, is exit 241 as before. - A landing in a directory that answers nothing is refused (exit 213), 9.80 ran:
chmod 000 out; hpcp a/ -d out/ -rfwent on in 9.80, because the run's own directory sync changedout's mode. With neither read nor search permission nothing can say whether a link inoutsends a file onto a source, and going on lost data, so hpcp names the directory and the fix (chmod u+rx out). One permission is enough to answer: a listing (0600) or a question by name for each landing (0300), and those run as they did. A link they find is followed, and a link that leads through a place the run cannot search is refused too. A directory no file lands in stops nothing: a source with a locked subdirectory repeats 9.80's exit on every run. - A failed copy leaves the destination's old file, 9.80 deleted it: when
cpfails, only what it changed goes, so a source that cannot be opened no longer costs the good copy a backup already holds. A part thatcpwrote still goes, also after the last retry, where 9.80 left it. - A source that holds the destination leaves it out, 9.80 made a copy of it:
hpcp . -d out/andhpcp .. -d out/, likefind . | hpcp -d out, now copy everything butout/itself, and one line says so. So does a directory named without a slash that is the destination:hpcp * -d backup/withbackupin the working directory leavesbackupout, on every run. Its files then count as any file of the destination: another source that lands on one overwrites it. 9.80 copied the destination into itself (out/out/..., one level deeper each run), reading files that other sources were writing, so such a copy could come out empty or cut short, exit 0.-rmethen checks nothing and says so: all that is in the destination belongs to that source. Moved, a source that holds the destination is still refused (exit 241); one that is the destination is left out (exit 0). ..lands in the destination, as.does:hpcp .. -d out/put the files inout/.., so they went next toout/andout/stayed empty. A landing never leaves its destination now: the contents of the directory land inout/, as withhpcp . -d out/,hpcp ../ -d out/andhpcp .. -d out, which always did that.- Overlays still work: directories that merge (
hpcp base/ overlay/ -d out) are not a clash: the later source's file wins, exit 0, as in 9.80. The winner is now the same in every mode (9.80's batch copies could race), and one line says how many files a later source replaced. In a move (-rm) nothing is removed when a later source replaced a file, since the earlier source holds that file's only copy: the destination has the later files, all sources stay, and hpcp exits 212. A source named twice (hpcp a/ b/ a/ -d out) wins its files back, as a sequential copy does. - List entries inside the destination are skipped: an entry whose path lies inside a destination (or is it) is not copied or moved, and counts as any file of the destination: another entry that lands on it overwrites it. One line says how many.
find . -name '*.log' | hpcp -d archive/ -rfcan run every night: the second run no longer movesarchive/app/app.logintoarchive/archive/.... With no-dthe destination is the working directory, sofind src | hpcpskips everything and exits 0. A directory that holds the destination (cd src && find . | hpcp -d out) is copied without the destination; moved, it is refused (exit 241), as a move onto itself is. A relative entry is copied, not skipped, only when it and the working directory share a directory strictly inside every destination that holds the entry (by each spelling of its path: as given, and through its links) and its landing is neither the entry nor below it:cd t/overlay; find etc -type f | hpcp -d ..lands them att/etc/.... Everything else stays and a second run finds the same: absolute entries, the destination itself and what is directly in it (cd t/a/b; printf '../../a\n' | hpcp -d ..), entries that would land on themselves (-d .). One case copies once:find ../../a -type ffromt/a/balso listst/a/b/g, which parts from the destination atb, so it lands att/a/a/b/g; the second run skips that copy too. - Known limitations and deferrals (see docs/limitations.md): a symlink in the destination at a directory's path is written through, with the target's mode and owner changed (deferred in 9.81 and still open in 9.82); with
-nds, a directory source meeting a file in the destination exits 70 with aFile existstraceback instead of a clean exit 213, the file untouched (deferred in 9.81, fixed in 9.83); positional-rmejudges the whole destination, not only where the source lands:hpcp b -d out/ -rmealso removesout/keep(deferred in 9.81 and still open in 9.82; see the-rmenote below);-rmecan take a source inside the destination for extra:hpcp out/sub/ b/ -d out/ -rme, answered y, deletesout/sub/x(deferred in 9.81 and still open in 9.82); a move of a link's directory and a path through the link can end in exit 192, nothing lost (deferred in 9.81 and still open in 9.82); the check before a copy holds a list's jobs in memory and scans existing destination directories one by one (deferred in 9.81 and still open in 9.82); a stored list used under another spelling can match by chance, and then-fl STORED -rmeoffers the other files for deletion (known limitation). -rmewith a list judges only below its directories; with only named files or links it checks nothing: with a list, only what the list's directories cover is cleaned; a list of files cleans nothing and says so, and everything else in the destination stays. 9.80 took everything in the destination that was not on the list for extra. To mirror a directory, list the directory itself (printf 'src\n' | hpcp -d out -rme): listing only its entries leaves what sits directly inout/srcalone. Arguments judge the whole destination as soon as one source is a directory: it is checked against everything the sources copy, sohpcp b -d out/ -rmewithba directory removesout/keep(after the prompt), as in 9.80; limiting that to where the source lands is deferred to 9.82 (docs/limitations.md). When every source is a named file or a link (hpcp a/x -d a -rme,hpcp lf -d . -rme), the files are copied,-rmesays it checked nothing and nothing else is touched (9.80 took the rest of the destination for extra after a prompt, or exited 212). A file with a directory (hpcp a/x e/ -d d -rme) or a directory alone cleans as before;hpcp a/x d/ -rmeno longer cleansd/.- Prompts with the list on stdin: when stdin held the list,
-rme,-rmand a move ask on/dev/tty, sofind ... | hpcp -d out -rmeworks at a terminal. With no terminal they refuse (exit 147), as before. When stdin was not the list nothing changes. - List parsing: lists are read as bytes, so any file name works under any locale. Data with a NUL byte is NUL-separated and exact (
find -print0,fd -0), with no flag. Otherwise lines split on newline only, a trailing CR is dropped, and a line with surrounding whitespace is the exact name when that exists, else the stripped one. - Rerunning a FIFO source no longer hangs (9.80 as well):
hpcp a/p -d out/or a list holding a FIFO, run a second time, waited forever, because the check for an identical file opened the FIFO. Only regular files are compared by content now; nodes of one kind for the same device (two FIFOs, two/dev/null) count as identical without being opened. - Dangling symlinks given as sources are copied as links (
-rmremoves them); 9.80 reported them as not found. -flfrom a list stores names with the list's tree.-fl STORED -rmewith a source from a list deletes nothing: give the source as an argument.-fl STORED -rmefixes (9.80 as well):-fl STORED -rmeonly compares the tree with the stored list and removes extras: it copies nothing and ignores-d, in 9.80 too.hpcp src -fl Sthenhpcp src -fl S -rmedeleted every file insrc, since the stored lines carry:digest(or:targetfor a link) and no name matched. A line now also means the name before each:in it, so a name that holds a:is kept too. A stored list is never split at NUL bytes (only-sfllists are), a missing one removes nothing (exit 208), one that shares no name with the tree (empty,/dev/null, made fors/and used fors, or the reverse) is nothing known too: it removes nothing, asks nothing, saysRemove skippedand exits 212, and a name with a line break is never removed: a stored list cannot tell it from two lines.
Copying from a list
hpcp reads source paths from -sfl FILE, from -sfl -, or from stdin when no source is given and stdin is not a terminal, so it takes the output of find or fd:
find src -type f -name '*.log' | hpcp -d out # out/src/.../x.log
cd src && find . -type f | hpcp -d ../out # out/.../x.log: cd to leave src out of the destination
find src -type f -print0 | hpcp -d out # NUL-separated: any file name is safe, no flag needed
fd -0 -e log . src | hpcp -d out
- Each path lands at
<dest>/<path as given>, normalised, without a leading/, and..never leaves the destination:../x/alands at<dest>/x/a. Directories the path implies that this run creates take their sources' mode and owner, so a private one stays private (-ndsskips that); one that exists already (a directory, a symlink, even a mount point) is left as it is. A directory that is itself on the list copies its metadata onto an existing one. - A list always means the destination is a directory, even for one entry.
- A directory in a list copies recursively. An entry below a listed directory is already covered, so plain
find src | hpcp -d outgives one complete tree, with nothing copied twice. - An entry inside the destination is not copied or moved (see Upgrading to 9.81); neither is the destination inside a listed directory.
- Arguments keep their own layout (
hpcp src -d outcopies the contents ofsrctoout). Given both, each source follows its own rule. -rmewith a list cleans only below the directories on the list:printf 'src\n' | hpcp -d out -rmemirrorssrctoout/src/...and leaves the rest ofoutalone. A directory skipped for lying inside the destination is not one of them. A list naming no directories checks nothing, and says so (so doeshpcp a/x -d out -rmewith only named files or links). It asks first, on/dev/ttywhen stdin holds the list; with no terminal it refuses (exit 147).-nbwith a list starts a worker pool per source, about 23 ms each, so keep the default batching for big lists. See docs/limitations.md.
Upgrading to 9.80 from 9.79
<TOOL>_PATHwarnings: every<TOOL>_PATHvariable (CP_PATH,MOUNT_PATH,DD_PATH, ...) that does not name an executable is now named once at the start of every run (Warning: CP_PATH=... is not an executable file; using cp from PATH.). 9.79 named one only when it started that tool itself, so a badCP_PATH(cp runs in the worker processes) was never named. A variable that other software sets for its own use prints that line too; it is harmless, and hpcp uses the tool found on PATH.- Removals: a removal (plain
-rm, a move,-rme, a forced patch apply:-siffwith-fa) now holds one directory descriptor per level of the tree, and hpcp raises its soft open-files limit to the hard one at start; the tools it runs inherit the higher limit. A tree deeper than the hard limit (ulimit -Hn: 524288 on systemd hosts, 4096 on EL7) stops with "Too many open files" errors and leaves its deep part. On macOS the soft limit (256) stays, so trees deeper than about 250 levels stop there. A forced apply already held one descriptor per level in 9.79 and stopped at the soft limit (often 1024), so it now removes deeper trees than before. See docs/limitations.md. - multiCMD 1.56 was required in 9.80 (
pipinstalls it). Without it, or with an older one, hpcp used its built-in copy, which was the full multiCMD 1.56; since 9.82 the built-in copy is 1.57 and is used whenever the installed one is older, while pip's floor stays 1.56 (see Upgrading to 9.82). - Correction to the 9.77 and 9.78 notes: they wrongly named Ubuntu 22.04. Only e2fsprogs 1.45.x-1.46.2 (EL8, Debian 11, Ubuntu 20.04) left the empty root-owned file
/hpcp-ext-feature-probe; 1.46.5 (Ubuntu 22.04) and 1.47 don't, and EL9 is untested. The file is safe to remove by hand.
Important Implementation Detail
By default, hpcp only checks:
- The file’s relative path/name is identical.
- The file mtime is identical.
- The last
-hs --hash_sizebytes (defaults to65536) are identical.
Although in most cases these checks should confirm that both files are identical, in certain scenarios (like bit rot), corrupted files might not be detected. If you need to verify file integrity rather than perform a quick sync, it is recommended to use the -fh --full_hash option.
A file or directory that cannot be read, listed or written is reported and the rest of the copy goes on; hpcp then exits with a non-zero code (Copy failed 190, Directory sync error 193, Source path not found 207, Listing error 209, ...). FIFOs, sockets and device nodes in a tree are not copied: each is noted (Special file skipped, no error); one named as a source is copied as cp -a copies it (on macOS, whose cp copies no socket, a named socket is skipped with a Special file skipped note).
Nothing below a destination is followed. A file that is already at the destination is written in place: hpcp opens it (never through a link, never waiting on a FIFO) and cp writes that open file (on Linux through /proc/PID/fd/N; off Linux, or where cp cannot reach it, by name, as in 9.84), so its inode stays, with what the filesystem keeps on it. A source that fails part way, a stop or a full disk can then cost the old copy (exit 190, the source kept): -rbw reads the source to its end first, and -wb keeps the old copy. A file with other names, one that cannot be opened for writing, one to be replaced by a FIFO, socket or device node source (cp -a makes those anew), and a FIFO, socket, device node or link below a destination are replaced by a new file written beside them (a hidden .hpcp_tmp_ name) and renamed over them once whole, never opened or written through; -wb does that for every rewrite, and that route never falls back to writing in place (the old copy stays, exit 190). What -d names itself is followed and written through, as cp does with its destination (a pipe, a disk image, a link). Before a copy that may not fit, on ext2/3/4, XFS and tmpfs, hpcp prints a Space warning and then tries, as cp does. As with cp -a, a non-root copy keeps the group when the user belongs to it but cannot keep another user's ownership, and then does not keep a set-user-ID / set-group-ID bit (on files or directories) for an owner / group it could not keep.
Symlinks are recreated as symlinks, as cp -a does: a link whose target is outside the copied tree (say ../shared/lib) is copied as it is and does not resolve at the destination unless the target is already there. With -lt --link_tracking, a relative symlink whose target is missing at the destination gets its target copied to the same relative place, which can be outside the destination directory (and can be a whole tree: data -> ../../scratch), so the link resolves there too. -nlt --no_link_tracking (the default) overrides -lt, and -lt does not apply with -dd (each partition's links are copied as they are). A new -di image is sized for the sources alone, not for what link tracking adds: a tracked tree that does not fit is reported as copy errors. With several destinations a relative link goes to the destination that holds its target. A link whose path is taken by a real file or directory in the destination is not created and is reported.
Setting -hs --hash_size to 0 disables hash checks entirely. This can be helpful on HDDs, as they usually have suboptimal seek performance. However, HDDs are also more prone to bit rot. If the operator can accept that risk, it is possible to rely solely on mtime checks for file comparison by setting hash_size to 0. (Though on a single HDD, the standard cp command is already well-optimized.)
Installation
pipx install hpcp
or
pip install hpcp
After installation, hpcp is available as hpcp. You can check its version and libraries via:
hpcp -V
It is recommended to install via pip, but hpcp can also function as a single script using Python’s default libraries.
On EL7 and EL8, run python3 -m pip install --user -U pip once before a --user install or upgrade: the stock pip there leaves the old version's record behind on pip3 install --user -U, so a later pip3 uninstall hpcp leaves it listed and pip3 install --user hpcp then does nothing (cas-toolbox's README, Installation, has the details and the way back). A venv, a system-wide install and a pinned hpcp==9.85 are not affected.
Note:
- On Python 3.7 and later
pipalso installs the hashing library xxhash, which can reduce CPU usage for partial hashing and increase performance when using-fh --full_hash. On Python 3.6 (EL7 and EL8) it does not, because building it there needs a compiler: hpcp uses blake2b instead. To add it, upgrade pip first (pip3 install -U pip, thenpip3 install xxhash): on stock pip 9.0.3 it fails there. - hpcp carries multiCMD, used to issue commands and provide helper functions: its built-in copy is the full multiCMD (1.67 in 9.94). An installed multiCMD is used when it is at least as new as that copy, and the built-in one otherwise (older, missing, or one that does not import). Since 9.89
pipinstalls none for hpcp.
Disk Imaging Feature Note
Only available on Linux currently!
-dd --disk_dump mode differs from the standard Linux dd program. hpcp will try to mount the block device/image file to a temporary directory and perform a file-based copy to an identically-created image file specified with -di --dest_image. This functionality is implemented crudely and is still an alpha feature. It works on basic partition types (it does not work with LVM) with GPT partition tables and has been proven able to clone live running system disks to disk images, which can then be booted without issues. A disk's partitions are the ones whose parent is the disk itself: devices stacked on them (md arrays, LVM, dm-crypt) and the partitions of such devices (a partitioned md array built on the disk) are never taken for the disk's own. A source partition that is not mounted is mounted read-only (an xfs with nouuid, so a clone of a disk whose xfs is mounted on this host can be read); the kernel still replays a dirty journal or log when the source device is writable, so the copy is of the recovered filesystem. A partition that is mounted (a live system disk) is mounted the way it is live, read-write when it is, since the kernel refuses a mount that would change that.
The created disk image can be resized using the -ddr --dd_resize option to the desired size. (This feature is provided so that you can shrink the raw size of the resulting image and provides some shrink capability for XFS.)
For partitions that hpcp cannot create a separate unique mount point, hpcp will fall back to using the Linux program dd to clone the drive. Note that this can be risky and can lead to broken filesystems if the drive is actively being written to. (However, since you generally cannot mount that partition on the current OS, the real-world scenarios for this remain limited.)
Filesystem parameter mirroring
In -dd mode hpcp reads each source filesystem's creation parameters and recreates the
destination with matching geometry and features, instead of whatever the local mkfs defaults
happen to be. Coverage varies by filesystem: ext2/3/4 (block size, inode size, inode ratio, reserved
percentage, full feature set), xfs (block/sector/inode/directory geometry and v5 feature flags),
btrfs (nodesize, sectorsize, checksum type, features), FAT (width, sector and cluster size, FAT
count, reserved sectors), ntfs and exfat (cluster and sector size), f2fs (geometry and features),
udf and reiserfs (block size and format), hfs+ (allocation block size), and minix (filesystem
version and filename length).
Without it, a clone built on a modern host can be unmountable or unbootable on the system it came
from — for example a FAT32 EFI System Partition recreated as FAT16, or an ext4 /boot that gains
metadata_csum and 64bit that its bootloader does not understand.
Size-dependent values are scaled rather than copied, so -ddr resizes stay valid: the ext inode
ratio and reserved percentage are mirrored, never absolute counts. If mkfs rejects a mirrored
parameter set, hpcp warns and retries with defaults rather than failing the copy. Use -nfp to
turn mirroring off entirely.
Patch Images Feature Note
Only available on Linux (loop devices and mounts, so usually root).
-diff [PATCH.img] compares a new tree (a directory, or a single-filesystem image with -si) against a base (-d DIR or -di IMG) and writes a patch image. The patch is an ordinary xfs/ext4 image, split with -dis like -di output. It holds every added or modified file whole at its real path, plus .hpcp_diff/manifest and .hpcp_diff/changes.tsv, which list every added, modified and deleted path with its before and after state. A moved file appears as one delete plus one add. A file counts as modified when its content, size, mtime, mode, owner, ACLs, file capabilities or user xattrs change; a directory when its mode, owner, ACLs or user xattrs change; a symlink when its target changes. Other xattrs (such as trusted.*, security.selinux or filesystem-internal ones) are ignored. Without a value the patch is named DIFF_<src>_TO_<base>_<time>.img. A file that changes between the comparison and the payload copy (on a live source) stops generation before any manifest is written; exclude it with -e or generate from an offline copy. For a directory source, -e and -x patterns are matched against its real paths, as when copying; for a -si image they are matched against / plus the path inside the image's filesystem, so -e '/var/log/*' leaves out what is under var/log there (and */tmp/* only a tmp/ inside it). Patterns written against hpcp's temporary mount path (for example /tmp/*/var/log/*) no longer match; write them as /… paths inside the filesystem. A pattern that would exclude the compared tree's root (such as -e /) is refused, and blank lines in an -x file are ignored. This run's input images (-si, -di) and the base or new directory are left out of the patch when they lie inside a directory being compared, so hpcp -diff / -di /root/golden-v1.img does not install the old image on every node. A payload copy is read again to check it only when its source may have changed since the comparison: on a read-only filesystem (a -si image, or a golden mounted read-only) only when the file's stat moved, and on a live one only when the file's inode, size, mtime or change time moved, it was changed shortly before the comparison (within twice the kernel's dirty-page writeback interval, about 70 seconds with default settings, since a write through a memory mapping may leave the change time alone until then; every copy when periodic writeback is off), or it lies on a filesystem whose change time hpcp does not rely on (anything but ext2/3/4, xfs, btrfs and f2fs). With -fh (and on FAT, whose files are always hashed in full) every copy is read again, whatever its source, so a copy that came out wrong is caught before the patch exists.
A -di image store keeps files at their absolute source path. When the base is such a store, a directory is compared only with its own subtree inside the store, and the patch uses the same layout. So hpcp -siff patch.img -di store.img updates the store in place, and hpcp -siff patch.img -d / updates the live system.
-siff PATCH.img applies a patch to -d DIR, -di IMG or a single path. Repeat it for every -dis volume. It first checks every path the patch touches. If the target differs from what the patch expects, it lists the conflicts and asks Apply anyway? [y/N]; the default, and any non-interactive run, aborts. -fa --force_apply applies anyway and prints each conflict as a warning. Re-running a patch is safe because already-updated paths are skipped, and every touched path is verified afterwards.
Files and symlinks are replaced atomically: the new version is written next to the old one, written to disk (an fsync, one file at a time as each is renamed) and renamed over it, so running processes keep the old file and an interrupted apply leaves each file either old or new. The fsync costs about 1 to 3 ms a file (5,000 rewritten files, 2 workers, idle EL7 VM: ext4 23 to 24 s without, 26 to 31 s with; XFS 26 s against 35 to 39 s); it is taken one file at a time in the parent's loop, because fsyncing in the workers measured slower there (ext4 38 to 53 s, XFS 41 to 44 s). A directory the patch deletes is removed only if it is empty once the patch's own deletions are done; whole trees are removed only for conflicts forced with -fa, and that removal never enters a mounted filesystem (bind mounts included): a directory holding a mount point is left in place with the mount, that row fails verify, and a note names the mount before the prompt. Paths are followed through symlinked directories that stay inside the target; if any path the patch deletes or writes resolves outside the target through a symlink, nothing is applied, even with -fa.
A single-filesystem patch pairs names by exact case, so a case-only rename (EFI/BOOT to EFI/Boot) is a delete plus an add, and the target ends with the new spelling. Rows are planned per filesystem: the target's own and each one mounted below it (for example the ESP at /boot/efi when applying to /). An automount (direct map) the patch writes into (an ESP that systemd mounts on demand, shown as autofs until something enters it) is mounted first, so it is planned as what it holds; one that cannot be mounted stops the apply before anything changes, and so does an indirect automount map (only its keys mount; leave it out of the patch with -e). A file written by one filesystem's rows and then removed, through a symlinked directory, by a later filesystem's delete is reported by verify (failed), not written again; and an entry replaced twice by contradictory rows of one patch can in principle reuse an inode number, which verify then cannot tell apart (both need patches that contradict themselves). On FAT, exFAT and HFS/HFS+ (not case-sensitive HFSX) names are matched case-insensitively, so such a rename applies, with or without a content change, and a re-run skips it. On FAT, exFAT and NTFS rows are compared and written by content only, since modes and owners there come from mount options. On FAT, which stores local times, a file whose mtime differs only by a timezone offset (a whole number of 15 minutes, at most 24 hours) with the same content counts as unchanged; files on FAT on either side when the patch is made (including a mount below the source root, such as /boot/efi) are hashed in full for this, whatever -hs says (a golden whose ESP was a plain directory is hashed by its tail, so there the tolerance covers files up to the -hs size only). Such a patch (for example a -diff of / with a FAT ESP mounted below it) is format version 3, which hpcp 9.68 and older refuse. A replaced FAT file keeps its read-only, hidden and system attributes. A write that lands on an entry another row found already done (through a symlinked directory, or a name differing only by case) is reported by verify. The filesystems are applied in turn, the target's own first; if one fails, the ones after it are not applied. When a delete removes an entry whose add or update was skipped as already done (a case-insensitive filesystem hpcp does not recognise, or a symlinked directory alias), the apply writes it again and counts it as restored.
An apply that is killed partway leaves directories it created private (mode 0700, owned by root) until the final metadata pass runs. Re-running the same patch then reports those directories as conflicts; re-run with -fa to finish.
changes.tsv is also what -dfl writes:
#hpcp-changes 1
#op path old new
D gone.txt f:<size>:<mtime_ns>:<mode>:<uid>:<gid>:<hash>:<xattr> -
A newdir/ - d:<mode>:<uid>:<gid>:<xattr>
M link l:old-target l:new-target
Paths escape \, tab, newline and carriage return as \\, \t, \n, \r.
Limitations:
- Hard links are not preserved; applying a patch breaks them.
- Special files (FIFOs, sockets, devices) are ignored.
- Even a small patch is an image of roughly 50 MiB.
- Generating and applying a patch need root (loop devices, mkfs, mount).
- Nothing else may modify the target while a patch is applied.
Disk patches (-dd)
hpcp -dd -diff [PATCH.img] NEW_DISK -d OLD_DISK patches whole GPT disks — for rolling a new golden image out to nodes cloned from the previous one. Both disks are block devices or disk-image files and are only read; MBR (msdos) disks are refused. The patch holds one section per filesystem partition (the same change list and payload as a single-filesystem patch), raw copies of areas that cannot be patched file by file when they changed (BIOS-boot and unknown-filesystem partitions, the MBR boot code), and the identity values that changed (filesystem UUID / label, GPT partition GUID / name / attributes, disk GUID). Swap contents are never carried. -e patterns are matched against / plus the path inside each partition's filesystem: -e '/var/log/*' leaves out what is under var/log on the root partition and -e '/EFI/Linux/*' what is under that directory on the ESP (a separate /var partition holds log/ at its root, so there the pattern is /log/*); */… patterns apply on every partition. This run's temporary directories and its disk-image files are left out wherever a live mount of a partition shows them: the whole filesystem, a btrfs subvolume mounted as the root (Fedora's root), or a bound directory.
hpcp -siff PATCH.img -d TARGET_DISK applies it to a node disk — a block device (a symlink such as /dev/disk/by-id/... is fine) or a disk-image file — offline or live:
- The target must have the base's layout: the same partition numbers, type GUIDs and filesystem types (sizes may differ, except raw areas). Layout changes need a re-clone.
- On a live disk, mounted partitions are patched through their live mount. Raw writes and identity changes to a partition that is mounted, active swap or held by LVM/md are refused before anything changes — apply such patches offline. An in-use raw area is not read, so it is refused even if it already holds the new content; an offline apply skips it then.
- FAT, exFAT and NTFS sections (the ESP) are compared and applied by content only: their permissions and owners come from mount options, so differences there are ignored. On FAT sections, files are hashed in full and a file whose mtime differs only by a timezone offset (a whole number of 15 minutes, at most 24 hours) with the same content counts as unchanged, since FAT stores local times (exFAT and NTFS record UTC times and get no such tolerance). A replaced FAT file keeps its read-only, hidden and system attributes. Names are generated by exact case, so a case-only rename (
EFI/BOOTtoEFI/Boot) is carried and the node ends with the golden's spelling; FAT, exFAT and HFS/HFS+ sections match names case-insensitively when applying (case-sensitive HFSX is detected). HFS and HFS+ sections compare owners and modes too (hfsplus keeps them on disk). - Filesystem sections are applied first (ESP last), then raw areas, the MBR boot code, and identity changes; everything is verified afterwards. A section that fails stops the apply before any later section, raw area, boot code or identity change (so does a failed restore or final verify across sections), and a raw area that cannot be written, or that does not hold the new content when read back right after its write, stops it before any later raw area, the boot code and identity changes (boot code that does so stops the identity changes): fix the cause and re-run, and the re-run skips what is already done. Apply prints one line per section and a total.
- Every partition the patch carries a raw area for (even one already done) or whose UUID or label it sets must open exclusively (
O_EXCL) before anything changes; one that is mounted, active swap or held by LVM/md/dm — in this or another mount namespace — is refused (Disk in use). During the raw writes and identity changes hpcp locks the whole disk (flock, so udev leaves it alone) and holds those partitions exclusively; raw areas are read back past the page cache. - A node's filesystem UUID or label that differs from the golden base is warned about and replaced only when the patch changes that value; otherwise the node keeps its own.
- Filesystem labels, GPT partition names and exFAT serials are read and written exactly: non-ASCII characters, spaces,
=and apostrophes included (GPT names keep leading and trailing spaces too; libblkid drops a filesystem label's trailing spaces, except on btrfs and NTFS, whose labels come from their own tools);-ddcopies keep them the same way. Disk patches made by hpcp 9.67–9.69 for disks with such labels or names recorded them mangled or cut short, so regenerate those patches. - Every refusal that needs no hash (a partition in use, an identity change that cannot be made, a missing raw payload, a section that cannot be mounted) comes before any raw area is read, and so does, when generating, a size change of a partition that is raw by its type (one that falls back to raw because it cannot be mounted is checked once that is found); a raw area too large for
-disis refused right after the raw areas are hashed when they alone force more than one volume (otherwise once the filesystems' payload is known). - An image file that is already attached to a loop device is refused (
Disk in use); apply to that loop device or detach it first. - A patch whose FAT files carry full-hash marks is written as format version 3 (patches made with
-fhor-hs 0carry none); hpcp 9.68 and older refuse it ("newer than supported"). Patches without them keep format 1 or 2.
Several Destinations
Several -d are spill-over, not copies: each file goes to one destination, the first with room (-rds: a random one), and an identical file at any destination is skipped. A file there that differs, even only in its mtime after a plain cp, is not skipped, and a different file at a later destination stays as a second version.
Remove Extra Feature Note
-rme --remove_extra: Especially when combined with -rf, PLEASE PAY CLOSE ATTENTION TO YOUR TARGET DIRECTORY!
--remove_extra removes the files that the sources do not copy, below where each directory source lands: all of the destination for src/ (it lands in out/ itself), only out/b for b, and what a list's directories cover for a list (see Copying from a list). A named file or a link judges nothing, so when every source is one (hpcp a/x -d out/ -rme), or a source is or holds the destination (hpcp . -d out/ -rme), it checks nothing, says so, and removes nothing. Check what is in a mirrored destination before you confirm. Nothing that is a source, lies in one, or holds one is removed, whatever the destination calls it: a source inside the destination (hpcp out/sub/ b/ -d out/ -rme keeps out/sub/x) stays, with a note. A link is judged as a link, not by where it leads: out/d -> ../src/d is an extra like any other, and goes.
It runs only after a copy that reported no errors: if a source path could not be listed, its copy in the destination would look extra. Otherwise hpcp leaves the destination as it is and exits with Remove skipped (212). With -di the image holds each source at its absolute path, and -rme compares against that layout: it mirrors the whole image to this run's sources, so another source copied into the same image on an earlier run is removed too. The destination's copy of an excluded path (-e, -x, absolute or not, a link's excluded target included) is never removed, and a directory that still holds one is kept. With -lt, link targets that link tracking placed in the destination are kept too; without it they are not part of the copy and are removed like any other extra file, unless excluded. A filesystem mounted below the destination (a mount or a bind mount, or another device such as a btrfs subvolume, as with rsync -x) is left alone with everything in it: its files are not listed as extra and its directories are not removed. That includes one mounted only when its directory is entered (an automount, an NFSv4 submount): each directory is checked once open, before anything in it is read. A destination, or a moved source, that is itself such a mount is taken as mounted. The destination's own filesystem is cleaned even when the destination is a mount point itself (a -di image, a disk). A filesystem's own lost+found (directly at its root, as in a -di image or an ext4 destination) and what fsck put in it are never removed.
Remove Feature Note
-rm --remove can remove files in bulk. This might be helpful on distributed file systems like Lustre: without a destination it walks each tree once, by directory descriptors (one open and one listing per directory, no stat per file), and with -pfl empties the directories in parallel jobs; -rwloff lists the trees first and then removes the listed files in parallel jobs. Every removal (plain -rm, a move, -rme) goes by directory descriptors from each source or destination, recorded before the confirmation prompt, without following symlinks: a source or destination replaced, or a directory in it swapped for a symlink, while hpcp runs (a tree other users can write to, with hpcp running as root) is not removed through, and is reported. Excluded paths stay, with the directories that hold them. As with rm --preserve-root, hpcp -rm / (or a bind mount of /) is refused (Invalid arguments, 241).
A removal (a forced patch apply, -siff with -fa, too) holds one directory descriptor per level of the tree, so a tree deeper than the open-files limit stops with "Too many open files" errors and leaves its deep part; see docs/limitations.md.
With a destination, -rm copies first and then removes the sources: a move. A move that lands a source on itself (hpcp -rm /data/x -d /data/, hpcp -rm a/ b/ -d a/) or whose destination lies inside it is refused before anything is copied (Invalid arguments, 241). A directory named without a slash that is itself the destination is left out, and the rest moves: hpcp a b -d b/ -rf moves a into b/, leaves b and exits 0. The sources are removed only if the copy reported no errors (a source named as an argument that is not there, a file that failed to copy, an unreadable directory, a path longer than 4096 characters, a link that could not be created); otherwise they are left in place and hpcp exits with Remove skipped (212). A move removes only the files and links the copy listed, then each source directory that is empty after that. Anything else stays where it is, with the directories that hold it: a file written to a source after the copy listed its directory, a special file (a FIFO, socket or device node, which hpcp does not copy), an excluded path. What stays, excluded paths aside, is named in a Move left entries note (exit code 0). A file changed after it was copied is still removed, as with mv, so stop writing to a source before moving it. The removal goes by directory descriptors from each source root, without following symlinks: a source root, or a directory in it, that was replaced (by a symlink, say) while the copy ran is not removed from, and is reported. Without a destination, -rm removes the whole source trees. If none of the given destinations can be used (a -d glob that matches nothing), nothing is copied or removed (No valid destination, 202); a -di image that does not exist yet is created first.
-rf --remove_force implies --remove. Use with care! This skips the interactive check requiring user confirmation before removing. If hpcp did not generate the correct file list from the specified source paths, hopefully you have fast enough reflexes to press Ctrl + C repeatedly to stop all parallel deletion processes if you realize a mistake.
-b --batch: Using -b with -rm will gather the file list for all source_paths first, then issue the remove command. This can be helpful because hpcp will tune its -f --files_per_job parameter accordingly for each task, and running one large remove job might be faster than running many small ones. This is especially useful when working with glob patterns like *.
$ hpcp -h
usage: hpcp.py [-h] [-s] [-j MAX_WORKERS] [-b | -nb] [-v] [-do] [-nds] [-fh]
[-hs HASH_SIZE] [-fpj FILES_PER_JOB] [-sfl SOURCE_FILE_LIST]
[-fl TARGET_FILE_LIST] [-cfl] [-dfl [DIFF_FILE_LIST]] [-tdfl]
[-nhfl] [-rm] [-rf] [-rme] [-rwloff] [-e EXCLUDE]
[-x EXCLUDE_FILE] [-lt] [-nlt] [-V] [-pfl] [-si SRC_IMAGE]
[-siff LOAD_DIFF_IMAGE] [-d DEST_PATH] [-rds] [-di DEST_IMAGE]
[-dis DEST_IMAGE_SIZE] [-diff [GET_DIFF_IMAGE]] [-fa] [-dd]
[-ddr DD_RESIZE] [-nfp] [-L RATE_LIMIT] [-F FILE_RATE_LIMIT]
[-tfs TARGET_FILE_SYSTEM] [-ncd] [-co] [-wb] [-rbw]
[-ctl COMMAND_TIMEOUT_LIMIT] [-enes]
[src_path ...]
Copy files from source to destination
positional arguments:
src_path Source Path
options:
-h, --help show this help message and exit
-s, --single_thread Use serial processing
-j, -m, -t, --max_workers MAX_WORKERS
Max workers for parallel processing. Default is 1 *
CPU count, and at least 16 for -rm and -rf (a move, or
a removal without -d), whose workers wait on their
fsyncs. Use negative numbers to indicate {n} * CPU
count, 0 means 1/2 CPU count.
-b, --batch Batch mode, process all files in one go
-nb, --no_batch, --sequential
Do not use batch mode
-v, --verbose Verbose output
-do, --directory_only
Only copy directory structure
-nds, --no_directory_sync
Do not sync directory metadata, useful for verfication
-fh, --full_hash Checks the full hash of files
-hs, --hash_size HASH_SIZE
Hash size in bytes, default is 65536. This means hpcp
will only check the last 64 KiB (about 1 page in a
SSD) of the file.
-fpj, --files_per_job FILES_PER_JOB
Base number of files per job, will be adjusted
dynamically. Default is 1
-sfl, -lfl, --source_file_list SOURCE_FILE_LIST
Load source paths from a file, or use "-" to read them
from stdin (read by default when no source is given
and stdin is not a terminal: find src -type f | hpcp
-d out). Each path lands in the destination as given,
minus a leading / and any .. (cd src && find . | hpcp
-d ../out to leave src out); a listed folder copies
recursively. Paths are not expanded and are separated
by newlines, or by NUL bytes when the data holds one
(find -print0, fd -0). If --compare_file_list is
specified, it will be used as source for compare
-fl, -tfl, --target_file_list TARGET_FILE_LIST
Specify the file_list file to store list of files in
src_path to. If --compare_file_list is specified, it
will be used as targets for compare
-cfl, --compare_file_list
Only compare file list. Use --file_list to specify a
existing file list or specify the dest_path to compare
src_path with. When not using with file_list, will
compare hash.
-dfl, --diff_file_list [DIFF_FILE_LIST]
Implies --compare_file_list, specify a file name to
store the diff file list to or omit the value to auto-
determine.
-tdfl, --tar_diff_file_list
Generate a tar compatible diff file list. ( update /
new files only )
-nhfl, --no_hash_file_list
Do not append hash to file list
-rm, --remove Remove all files and folders specified in src_path
-rf, --remove_force Remove all files without prompt
-rme, --remove_extra Remove the files and folders the sources do not copy,
below where each directory source lands (all of out/
for src/, out/b for b); never a source, or what lies
in or holds one
-rwloff, --do_not_remove_files_while_listing
With -rm and no destination: list the trees first,
then remove the listed files in parallel jobs
(default: remove while walking the trees).
-e, --exclude EXCLUDE
Exclude source files matching the pattern
-x, --exclude_file EXCLUDE_FILE
Exclude source files matching the pattern in the file
-lt, --link_tracking Also copy the target of a relative symlink when the
destination does not have it, to the same place
relative to the link (this can be outside the
destination). Default: off, symlinks are copied as
they are.
-nlt, --no_link_tracking
Do not copy the files that symlinks point to (the
default). Overrides -lt.
-V, --version show program's version number and exit
-pfl, --parallel_file_listing
Use parallel processing for file listing
-si, --src_image SRC_IMAGE
Source Image, mount the image and copy the files from
it.
-siff, --load_diff_image LOAD_DIFF_IMAGE
Apply a patch image made by -diff to the target (-d /
-di or a single path). Repeat for each -dis volume.
Every path the patch touches is checked first;
conflicts prompt before being overridden. A disk patch
(made with -dd -diff) takes the target disk with -d.
-d, -C, --dest_path DEST_PATH
Destination Path. Repeat it to spill over: each file
goes to one destination, the first with room, not to
all of them.
-rds, --random_dest_selection
Randomly select destination path from the list of
destination paths instead of the first with room. Can
speed up transfer if dests are on different devices.
Warning: can cause unable to fit in big files as dests
are filled up by smaller files.
-di, --dest_image DEST_IMAGE
Base name for destination Image, create a image file
and copy the files into it.
-dis, --dest_image_size DEST_IMAGE_SIZE
Destination Image Size, specify the size of the
destination image to split into. Default is 0 (No
split). Example: 10TiB or 1G
-diff, --get_diff_image [GET_DIFF_IMAGE]
Generate a patch image that updates the base (-d /
-di) to the source (src_path / -si): added and
modified files in full plus a change list under
.hpcp_diff/. Optionally name the output; default
DIFF_<src>_TO_<base>_<time>.img. Honors -dis, -fh, -hs
and -e. With -dd, compares whole GPT disks: the new
disk as the path and the old disk with -d.
-fa, --force_apply With -siff, apply even when the target differs from
the state the patch expects. Conflicts are still
printed as warnings.
-dd, --disk_dump Disk to Disk mirror, use this if you are backuping /
deploying an OS from / to a disk. Require 1 source,
can be 1 src_path or 1 -si src_image, require 1 -di
dest_image. Note: will only actually use dd if unable
to mount / create a partition.
-ddr, --dd_resize DD_RESIZE
Resize the destination image to the specified size
with -dd. Applies to biggest partiton first. Specify
multiple -ddr to resize subsequent sized partitions.
Example: 100GiB or 200G
-nfp, --no_fs_param_mirror
Do not mirror source filesystem parameters (geometry,
features) in -dd mode. Create destination filesystems
with mkfs defaults, preserving only label and UUID.
-L, -rl, --rate_limit RATE_LIMIT
Approximate a rate limit the copy speed in
bytes/second. Example: 10M for 10 MB/s, 1Gi for 1
GiB/s. Default is 0: no rate limit.
-F, -frl, --file_rate_limit FILE_RATE_LIMIT
Approximate a rate limit the copy speed in
files/second. Example: 10K for 10000 files/s, 1Ki for
1024 files/s. Default is 0: no rate limit.
-tfs, --target_file_system TARGET_FILE_SYSTEM
Specify the target file system type, as df -T names it
(macOS: as statfs does, such as apfs or msdos). A
destination of another type, or whose type cannot be
read, is left out (exit 227), and the run stops when
none is left. Example: ext4, xfs, f2fs, vfat, exfat.
Default is None: do not check target file system type.
-ncd, --no_create_dir
Ignore any destination folder that does not already
exist. ( Will still copy if dest is a file )
-co, --content_only Content-only copy: do not sync mode, owner, or
timestamps on files or directories. A destination file
with other hard links is replaced, not written
through. A FIFO, socket or device node is made as cp
-a makes it, never read. Still create missing
destination directories using filesystem-default
permissions (so parent ACL/setgid/setuid inherit).
-wb, --write_beside, --write-beside
Write every rewrite to a new file beside the old one,
write it to disk and rename it over the old one once
whole: a source that fails, a full disk or a stop
leave the old copy as it was. The file gets a new
inode (a per-file Lustre or GPFS layout, chattr flags
and a project id are not kept; NFS readers holding it
open may get ESTALE). Needs a new name in the file's
directory and room for a second copy: without either
the old copy stays (exit 190). By default a rewrite is
written in place, and only a file with other names,
one that cannot be opened for writing, or a FIFO,
device or link goes beside.
-rbw, --read_before_write, --read-before-write
Before a file at the destination is written in place,
read its source to the end: a source that fails on
read leaves the old copy as it is (exit 190). Costs a
second read of each rewritten file. Does nothing with
-wb, which writes nothing in place.
-ctl, --command_timeout_limit COMMAND_TIMEOUT_LIMIT
Set the command timeout limit in seconds for external
commands ( ex. cp / dd ). Default is 0: no timeout.
-enes, --exit_not_enough_space
Skip a source whose copy does not fit the
destinations' free space, counting only what the copy
will write (files already there and the same are not
counted, a rewrite only what it adds); the run exits
228. Without it, a copy that may not fit is tried,
with a warning on ext2/3/4, XFS and tmpfs (a
compressing filesystem can fit more than its free
space).
Metadata
Release files for hpcp 9.94
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hpcp-9.94.tar.gz | 856.1 kB | Without provenance | Details for hpcp-9.94.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hpcp-9.94-py3-none-any.whl | Python 3 | none | any | Details for hpcp-9.94-py3-none-any.whl |
Total release size: 1.2 MB
Release files / hpcp-9.94.tar.gz
| Download URL | hpcp-9.94.tar.gz |
|---|---|
| Size | 856.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
298b71577d1dcb3792c02a02e91d6bd756f9e7afe1d1109c44c802c430d58597
|
|
BLAKE2b-256 checksum How to use checksums |
f2b92c3e03553212eb6a84c544325ae0dc0b8c04af7222720f29d667ea9b645c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / hpcp-9.94-py3-none-any.whl
| Download URL | hpcp-9.94-py3-none-any.whl |
|---|---|
| Size | 336.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fc95ef7e9f53acd48ec681292203b9fcbea649a8aeca4a649dfc52caee08d16
|
|
BLAKE2b-256 checksum How to use checksums |
114e7c303f43ddfd8cc423a96ed26e1dd367dc91758c28daf3740a58ab94939b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for hpcp 9.94
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.