Merge branch 'master' of /srv/git/myshellconfig

This commit is contained in:
Jakobus Schürz 2021-01-15 09:54:19 +01:00
commit 52878eb744
5 changed files with 23 additions and 20 deletions

View file

@ -100,7 +100,7 @@ EOF
fi
else
local seconds=$(( $( date --date="@$(stat --printf %Y ${MSC_GIT_UPD_REPO_STATFILE} 2>/dev/null || echo 0 )" "+%s") - $(date --date="${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours ago" "+%s") ))
logwarn "sync-intervall (${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours) not reached yet. $((seconds/86400)) days $(date -d "1970-01-01 + $seconds seconds" "+%H hours %M minutes %S seconds") left."
logwarn "repo sync-intervall (${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours) not reached yet. $((seconds/86400)) days $(date -d "1970-01-01 + $seconds seconds" "+%H hours %M minutes %S seconds") left."
return 2
fi
else
@ -111,13 +111,11 @@ EOF
}
lastupdatesubmodules () {
#date "+%s" > ${MSC_GIT_UPD_SUBMOD_STATFILE}
touch ${MSC_GIT_UPD_REPO_STATFILE}
touch ${MSC_GIT_UPD_SUBMOD_STATFILE}
}
export -f lastupdatesubmodules
lastupdaterepo () {
#date "+%s" > ${MSC_GIT_UPD_REPO_STATFILE}
touch ${MSC_GIT_UPD_REPO_STATFILE}
}
export -f lastupdaterepo

View file

@ -38,28 +38,32 @@ help () {
renameinplace: rename file to YYYYMMDD_HHmmss-c.ext in place (just rename file)
rename: move like true, but rename ist like renameinplace
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;
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
# destination
dest=$dest
mimedestpic=$mimedestpic
mimedestvid=$mimedestvid
subdestpic=$subdestpic
subdestvid=$subdestvid
# or set subdestdefault, which is default for subdestpic and subdestvid
subdestdefault=$subdestdefault
# final destinationpath
${dest}/${mimedestpic}/${subdestpic}/%Y/%Y_%m"
${dest}/${mimedestvid}/${subdestvid}/%Y/%Y_%m"
Supported Filet-extensions
*.jpg, *.jpeg, *.png, *.mp4, *.3gp, *.gif
*.jpg, *.jpeg, *.png, *.mp4, *.mov, *.3gp, *.gif
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)
# set datetimeoriginal and createdate from given file (only one is possible)
@ -157,7 +161,7 @@ run_fix () {
image/gif)
MIMEDEST="${mimedestpic}/${subdestpic}"
;;
video/mp4|video/m4a|video/3gpp)
video/mp4|video/m4a|video/3gpp|application/octet-stream)
MIMEDEST="${mimedestvid}/${subdestvid}"
;;
*)
@ -317,9 +321,9 @@ if [ $# -gt 0 ]; then
esac
else
loginfo "Progress all *.jpg, *.jpeg, *.png and mp4, *.3gp, *.gif files in pwd $(pwd)"
all=$(find ${maxdepth:+-maxdepth} ${maxdepth:+$maxdepth} -type f |grep -i ".jpg$\|.jpeg$\|.mp4$\|.png$\|.3gp$\|.gif$"|wc -l)
find ${maxdepth:+-maxdepth} ${maxdepth:+$maxdepth} -type f |grep -i ".jpg$\|.jpeg$\|.mp4$\|.png$\|.3gp$\|.gif$"|while read file; do
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$\|.mov$\|.png$\|.3gp$\|.gif$"|wc -l)
find ${maxdepth:+-maxdepth} ${maxdepth:+$maxdepth} -type f |grep -i ".jpg$\|.jpeg$\|.mp4$\|.mov$\|.png$\|.3gp$\|.gif$"|while read file; do
let "i=i+1"
loginfo "$i/$all"
run_fix "$file"

View file

@ -72,13 +72,13 @@ done
if [ $(stat --printf %Y ${MSC_GIT_UPD_SUBMOD_STATFILE} 2>/dev/null || echo 0 ) \
-lt $(date --date="${MSC_GIT_SUBMODULES_UPDATE_INTERVALL-${MSC_GIT_SUBMODULES_UPDATE_INTERVALL_DEFAULT}} hours ago" "+%s") \
-a ${MSC_GIT_SUBMODULES_UPDATE-${MSC_GIT_SUBMODULES_UPDATE_DEFAULT-true}} ]; then
[ -z "${dorepoupdate+x}" ] && dorepoupdate="true"
[ -z "${dosubmodupdate+x}" ] && dosubmodupdate="true"
fi
if [ $(stat --printf %Y ${MSC_GIT_UPD_REPO_STATFILE} 2>/dev/null || echo 0 ) \
-lt $(date --date="${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours ago" "+%s") \
-a ${MSC_GIT_REPO_UPDATE-${MSC_GIT_REPO_UPDATE_DEFAULT-true}} ]; then
[ -z "${dosubmodupdate+x}" ] && dosubmodupdate="true"
[ -z "${dorepoupdate+x}" ] && dorepoupdate="true"
fi
#echo $SGIT fetch ${MSC_GIT_REMOTE_NAME} -p 1>&2

View file

@ -117,7 +117,6 @@ export HISTTIMEFORMAT='%F %T '
export HISTSIZE=999999
loginfo "bashrc_add sourced" 2>&1 |tee -a ${MSC_LOGFILE} >&2
#echo "bashrc_add sourced" >&2
# Export several functions for being usable in subshells
export -f token
@ -138,8 +137,3 @@ export -f reachable-default
[ -z "${SSH_AGENTS_DEFAULT_DIR+x}" ] || mkdir -p "${SSH_AGENTS_DEFAULT_DIR}"
#cat << EOF > "${SSH_AGENTS_DEFAULT_DIR}/agent-default-$(hostname)"
#SSH_AUTH_SOCK=${SSH_AUTH_SOCK}; export SSH_AUTH_SOCK;
#SSH_AGENT_PID=${SSH_AGENT_PID}; export SSH_AGENT_PID;
#loginfo Agent pid ${SSH_AGENT_PID};
#EOF

7
sshs_addfiles.conf Normal file
View file

@ -0,0 +1,7 @@
${MSC_BASE}/functions.sh
${MSC_BASE}/logging
${MSC_BASE}/myshell_load_fortmpconfig
$(getbashrcfile) ~/.aliases
${MSC_BASE}/aliases
${MSC_BASE}/PS1
${MSC_BASE}/bash_completion.d/*