Saya hanya berlari melintasi ini sendiri, dan cp
perintah bawaan sebenarnya menanganinya.
Saya menemukan banyak kartu CF lama yang ingin saya ambil gambarnya. Skrip pemrosesan saya akan melihat file mtime untuk meletakkannya di tempat yang benar sehingga saya membutuhkannya dipertahankan.
Dari halaman manual :
-p Cause cp to preserve the following attributes of each source file in the copy: modification time,
access time, file flags, file mode, user ID, and group ID, as allowed by permissions. Access
Control Lists (ACLs) and Extended Attributes (EAs), including resource forks, will also be pre-
served.
If the user ID and group ID cannot be preserved, no error message is displayed and the exit value
is not altered.
If the source file has its set-user-ID bit on and the user ID cannot be preserved, the set-user-
ID bit is not preserved in the copy's permissions. If the source file has its set-group-ID bit
on and the group ID cannot be preserved, the set-group-ID bit is not preserved in the copy's per-
missions. If the source file has both its set-user-ID and set-group-ID bits on, and either the
user ID or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits are pre-
served in the copy's permissions.
Jadi, menggunakan zsh
saya dapat menjalankan ( NO NAME
menjadi nama volume kartu saya):
cp -rvp /Volumes/NO\ NAME/DCIM/**/*.{JPG,jpg} ~/Desktop/tmp/pics
Saya percaya bahwa /**/*
konstruksi khusus khusus untuk ZSH; namun Anda dapat melakukan sesuatu seperti
find /Volumes/WHATEVER -type d -print0 | xargs cp -vp {}/*.JPG /my/out/path