df -Pm
A command under Linux/Unix used to check file system disk space usage. The combined -P and -m parameters provide POSIX-format output in units of MB.
Timeline (last 90 days)
A low-cost way to check that the workspace is writable and has spare capacity is to use a touch probe file and then check available space with df -Pm.
In df -Pm, -P forces POSIX format to ensure a fixed six columns per line, and -m outputs in MB; combining the two lets scripts parse available space by stable column numbers; if the target system does not have GNU coreutils (such as BusyBox or macOS), the df -Pm arguments may not be accepted, and the preflight script needs a fallback branch.
The core logic of the preflight script preflight.sh is to assert the five assumptions and print the results line by line, exiting with a non-zero code on any failure; implementation details include: the workspace check uses mkdir -p plus a touch probe and gets available MB with df -Pm (default threshold 512MB), the clock check compares the Date header of the first outbound host with local UTC time (default tolerance 120 seconds), the credential check outputs only the first 10 characters of sha256, and the run lock uses exec 9>"$LOCK" plus flock -n 9.
All Facts (3)
A low-cost way to check that the workspace is writable and has spare capacity is to use a touch probe file and then check available space with df -Pm.
50%UnverifiedIn df -Pm, -P forces POSIX format to ensure a fixed six columns per line, and -m outputs in MB; combining the two lets scripts parse available space by stable column numbers; if the target system does not have GNU coreutils (such as BusyBox or macOS), the df -Pm arguments may not be accepted, and the preflight script needs a fallback branch.
50%UnverifiedThe core logic of the preflight script preflight.sh is to assert the five assumptions and print the results line by line, exiting with a non-zero code on any failure; implementation details include: the workspace check uses mkdir -p plus a touch probe and gets available MB with df -Pm (default threshold 512MB), the clock check compares the Date header of the first outbound host with local UTC time (default tolerance 120 seconds), the credential check outputs only the first 10 characters of sha256, and the run lock uses exec 9>"$LOCK" plus flock -n 9.
50%