Merge branch 'master' of git.schuerz.at:public/myshellconfig

This commit is contained in:
Jakobus Schürz 2021-01-12 11:04:02 +01:00
commit b36d5c3632

View file

@ -38,28 +38,32 @@ help () {
renameinplace: rename file to YYYYMMDD_HHmmss-c.ext in place (just rename file) renameinplace: rename file to YYYYMMDD_HHmmss-c.ext in place (just rename file)
rename: move like true, but rename ist like renameinplace rename: move like true, but rename ist like renameinplace
copyrename: rename file in place and copy it to final destination with new name copyrename: rename file in place and copy it to final destination with new name
forcedate=$forcedate [fase|true] false: datetimeoriginal and createdate is only updated from filename, if not set; true: tags are always updated forcedate=$forcedate [false|true] false: datetimeoriginal and createdate is only updated from filename, if not set; true: tags are always updated
setdate=$setdate [false|true] false: do not set date-tags, only if you are sure, tags are ok, and you want move or copy files; setdate=$setdate [false|true] false: do not set date-tags, only if you are sure, tags are ok, and you want move or copy files;
setoriginalfilenamee=$setoriginalfilename [false|true|force] false: do not set originalfilename from filname (default); true: set it, if not set; force: set it, also if exists; setoriginalfilename=$setoriginalfilename [false|true|force] false: do not set originalfilename from filname (default); true: set it, if not set; force: set it, also if exists;
setartist=$setartist [false|true|<User Name>] true: set USERNAME from user, running the script; <User Name> set this User Name setartist=$setartist [false|true|<User Name>] true: set USERNAME from user, running the script; <User Name> set this User Name
# destination # destination
dest=$dest dest=$dest
mimedestpic=$mimedestpic mimedestpic=$mimedestpic
mimedestvid=$mimedestvid mimedestvid=$mimedestvid
subdestpic=$subdestpic subdestpic=$subdestpic
subdestvid=$subdestvid subdestvid=$subdestvid
# or set subdestdefault, which is default for subdestpic and subdestvid
subdestdefault=$subdestdefault
# final destinationpath # final destinationpath
${dest}/${mimedestpic}/${subdestpic}/%Y/%Y_%m" ${dest}/${mimedestpic}/${subdestpic}/%Y/%Y_%m"
${dest}/${mimedestvid}/${subdestvid}/%Y/%Y_%m" ${dest}/${mimedestvid}/${subdestvid}/%Y/%Y_%m"
Supported Filet-extensions Supported Filet-extensions
*.jpg, *.jpeg, *.png, *.mp4, *.3gp, *.gif *.jpg, *.jpeg, *.png, *.mp4, *.mov, *.3gp, *.gif
Examples: Examples:
# Scan current directory for all jpg|jpeg|mp4|png files, set datetimeoriginal and createdate # Scan current directory for all jpg|jpeg|mp4|mov|png|3gp|gif files, set datetimeoriginal and createdate
$(basename $0) $(basename $0)
# set datetimeoriginal and createdate from given file (only one is possible) # set datetimeoriginal and createdate from given file (only one is possible)
@ -157,7 +161,7 @@ run_fix () {
image/gif) image/gif)
MIMEDEST="${mimedestpic}/${subdestpic}" MIMEDEST="${mimedestpic}/${subdestpic}"
;; ;;
video/mp4|video/m4a|video/3gpp) video/mp4|video/m4a|video/3gpp|application/octet-stream)
MIMEDEST="${mimedestvid}/${subdestvid}" MIMEDEST="${mimedestvid}/${subdestvid}"
;; ;;
*) *)
@ -317,9 +321,9 @@ if [ $# -gt 0 ]; then
esac esac
else else
loginfo "Progress all *.jpg, *.jpeg, *.png and mp4, *.3gp, *.gif files in pwd $(pwd)" loginfo "Progress all *.jpg, *.jpeg, *.png and mp4, *.3gp, *.gif *.mov files in pwd $(pwd)"
all=$(find ${maxdepth:+-maxdepth} ${maxdepth:+$maxdepth} -type f |grep -i ".jpg$\|.jpeg$\|.mp4$\|.png$\|.3gp$\|.gif$"|wc -l) all=$(find ${maxdepth:+-maxdepth} ${maxdepth:+$maxdepth} -type f |grep -i ".jpg$\|.jpeg$\|.mp4$\|.mov$\|.png$\|.3gp$\|.gif$"|wc -l)
find ${maxdepth:+-maxdepth} ${maxdepth:+$maxdepth} -type f |grep -i ".jpg$\|.jpeg$\|.mp4$\|.png$\|.3gp$\|.gif$"|while read file; do find ${maxdepth:+-maxdepth} ${maxdepth:+$maxdepth} -type f |grep -i ".jpg$\|.jpeg$\|.mp4$\|.mov$\|.png$\|.3gp$\|.gif$"|while read file; do
let "i=i+1" let "i=i+1"
loginfo "$i/$all" loginfo "$i/$all"
run_fix "$file" run_fix "$file"