From 7a50ca69a37ca2a61ab7f1b1a3ff0b22d0b67aeb Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Tue, 10 Feb 2026 14:57:59 +0100 Subject: [PATCH] fix camera-copy mkdir --- modules/media-process.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/media-process.nix b/modules/media-process.nix index ee22813..9901d73 100644 --- a/modules/media-process.nix +++ b/modules/media-process.nix @@ -167,10 +167,15 @@ echo "[$date_dir] $filename" + local target_dir="$DEST/$year/$date_dir" + if [[ "$DEST" != *:* ]]; then + mkdir -p "$target_dir" + fi + local rsync_opts=(-a --mkpath --progress --partial --ignore-existing) [[ $delete_source -eq 1 ]] && rsync_opts+=(--remove-source-files) - if ${pkgs.rsync}/bin/rsync "''${rsync_opts[@]}" "$file" "$DEST/$year/$date_dir/$filename"; then + if ${pkgs.rsync}/bin/rsync "''${rsync_opts[@]}" "$file" "$target_dir/$filename"; then ((copied++)) || true else echo " Failed to copy: $file"