fix camera-copy mkdir
This commit is contained in:
parent
33494bb16c
commit
7a50ca69a3
1 changed files with 6 additions and 1 deletions
|
|
@ -167,10 +167,15 @@
|
||||||
|
|
||||||
echo "[$date_dir] $filename"
|
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)
|
local rsync_opts=(-a --mkpath --progress --partial --ignore-existing)
|
||||||
[[ $delete_source -eq 1 ]] && rsync_opts+=(--remove-source-files)
|
[[ $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
|
((copied++)) || true
|
||||||
else
|
else
|
||||||
echo " Failed to copy: $file"
|
echo " Failed to copy: $file"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue