first commit

This commit is contained in:
Oliver Bohlen
2022-07-06 12:24:21 +02:00
commit 292dc8ccff
46 changed files with 1323 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#!/bin/bash
function g_imagesorttonextclouddir {
if ! [ -d ~/"Nextcloud/Fotos" ]
then
g_echo_error "Verzeichnis ~/Nextcloud/Fotos existiert nicht"
return 1
fi
find . -name "*_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9].*" | while read g_image
do
local g_bfile=$(basename "$g_image")
local g_dir=$(echo "$g_bfile" | perl -pe 's/^....(....)(..).+$/$1\/$2/')
mkdir -p ~/"Nextcloud/Fotos/$g_dir"
mv -n "$g_image" ~/"Nextcloud/Fotos/$g_dir/"
done
}