diff options
| author | tv <tv@krebsco.de> | 2026-12-01 03:26:27 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-12-01 03:26:27 +0000 |
| commit | bc9b11b3b67671a014779d90998ebd66073eb063 (patch) | |
| tree | cc971ffa234d7010edb24565faaaec8edfdb15b3 /krops.nix | |
| parent | 7ac7990c9b76aa9e9aba6a15974c22e37c024a00 (diff) | |
krops.nix: put enstate submissions in place in one step
From /run to /var/lib/enstate, mv copies, so a submission was briefly
half there in the incoming directory. Now each is copied under a dot
name, which enstate skips, and renamed.
Diffstat (limited to 'krops.nix')
| -rw-r--r-- | krops.nix | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -203,9 +203,15 @@ rec { forgetPending = /* sh */ '' trap 'rm -fR ${pending}' EXIT ''; + # Copied under a dot name, which enstate skips, and renamed: from memory + # to disk, mv would copy, and enstate could see half a submission. movePending = /* sh */ '' mkdir -p -m 0700 ${stateDir} ${stateDir}/incoming - find ${pending} -mindepth 1 -maxdepth 1 -exec mv -t ${stateDir}/incoming {} + + find ${pending} -mindepth 1 -maxdepth 1 -printf '%f\n' | + while read -r submission; do + cp -a ${pending}/"$submission" ${stateDir}/incoming/."$submission" + mv ${stateDir}/incoming/."$submission" ${stateDir}/incoming/"$submission" + done ''; }; |
