latest versions
This commit is contained in:
31
photoimport/copycurrentdirvideostolas1
Normal file
31
photoimport/copycurrentdirvideostolas1
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env zsh
|
||||
set -x
|
||||
set -e
|
||||
set -o nullglob
|
||||
|
||||
YYYYMMDD="$(date "+%Y-%m-%d")"
|
||||
RSYNCOPTS="-ah --no-inc-recursive --info=progress2"
|
||||
RDST="root@las1stor1:/srv/pool.2024.04/berlin.sneak.fs.video"
|
||||
|
||||
function amLocalToVideoStore() {
|
||||
ifconfig | grep 10.100.205 | wc -l
|
||||
}
|
||||
|
||||
function copyVideosToVideoStore() {
|
||||
rsync \
|
||||
-ah --no-inc-recursive --info=progress2 \
|
||||
./ "$RDST"/ && \
|
||||
rsync \
|
||||
-ah --no-inc-recursive --info=progress2 \
|
||||
--remove-source-files \
|
||||
./ "$RDST"/ && \
|
||||
rm -rfv ./ && \
|
||||
}
|
||||
|
||||
function main() {
|
||||
if [[ $(amLocalToLAS1) -gt 0 ]]; then
|
||||
copyVideosToLAS1
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
33
photoimport/copyvideostolas1
Normal file
33
photoimport/copyvideostolas1
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env zsh
|
||||
set -x
|
||||
set -e
|
||||
set -o nullglob
|
||||
|
||||
YYYYMMDD="$(date "+%Y-%m-%d")"
|
||||
DST="$HOME/_TODO/$YYYYMMDD-video-import"
|
||||
RSYNCOPTS="-ah --no-inc-recursive --info=progress2"
|
||||
RDST="root@las1stor1:/srv/pool.2024.04/berlin.sneak.fs.video"
|
||||
|
||||
function amLocalToLAS1() {
|
||||
ifconfig | grep 10.100.205 | wc -l
|
||||
}
|
||||
|
||||
function copyVideosToLAS1() {
|
||||
rsync \
|
||||
-ah --no-inc-recursive --info=progress2 \
|
||||
"$DST"/ "$RDST"/ && \
|
||||
rsync \
|
||||
-ah --no-inc-recursive --info=progress2 \
|
||||
--remove-source-files \
|
||||
"$DST"/ "$RDST"/ && \
|
||||
rm -rfv "$DST" && \
|
||||
ssh root@las1stor1 "cd /srv/pool.2024.04/berlin.sneak.fs.video && chown -R nobody:nogroup ."
|
||||
}
|
||||
|
||||
function main() {
|
||||
if [[ $(amLocalToLAS1) -gt 0 ]]; then
|
||||
copyVideosToLAS1
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
||||
24
photoimport/import-current-dir-videos
Normal file
24
photoimport/import-current-dir-videos
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env zsh
|
||||
set -x
|
||||
set -e
|
||||
set -o nullglob
|
||||
|
||||
YYYYMMDD="$(date "+%Y-%m-%d")"
|
||||
RSYNCOPTS="-ah --no-inc-recursive --info=progress2"
|
||||
RDST="root@las1stor1:/srv/pool.2024.04/berlin.sneak.fs.video"
|
||||
|
||||
function rename_to_format() {
|
||||
f2 -r '{{mtime.YYYY}}/{{mtime.YYYY}}-{{mtime.MM}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}.{{f}}.{{hash.sha256}}{{ext}}' -x --verbose
|
||||
}
|
||||
|
||||
function import() {
|
||||
rename_to_format
|
||||
rsync -avP ./2* $RDST/
|
||||
}
|
||||
|
||||
|
||||
function main() {
|
||||
import
|
||||
}
|
||||
|
||||
main
|
||||
19
photoimport/photoimport
Executable file → Normal file
19
photoimport/photoimport
Executable file → Normal file
@@ -5,14 +5,13 @@ set -o nullglob
|
||||
|
||||
YYYYMMDD="$(date "+%Y-%m-%d")"
|
||||
|
||||
|
||||
function downloadPhotos() {
|
||||
SRC=(/Volumes/*/DCIM)
|
||||
if [[ ! -d "$SRC" ]]; then
|
||||
echo "no photos" > /dev/stderr
|
||||
return
|
||||
fi
|
||||
DST="$HOME/Library/Syncthing/folders/LightroomMasters-CurrentYear/toimport"
|
||||
DST="$HOME/Pictures/_ORIG"
|
||||
du -sh "$SRC"
|
||||
rsync -ah --no-inc-recursive --info=progress2 --remove-source-files "$SRC"/ $DST/$YYYYMMDD/
|
||||
cd "$DST/$YYYYMMDD"
|
||||
@@ -20,26 +19,10 @@ function downloadPhotos() {
|
||||
f2 -r '../{{mtime.YYYY}}/{{mtime.YYYY}}-{{mtime.MM}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}.{{x.model}}.{{f}}.{{hash.sha256}}{{ext}}' -x --verbose
|
||||
}
|
||||
|
||||
function downloadVideos() {
|
||||
SRC=(/Volumes/*/PRIVATE/M4ROOT/CLIP)
|
||||
if [[ ! -d "$SRC" ]]; then
|
||||
echo "no videos" > /dev/stderr
|
||||
return
|
||||
fi
|
||||
DST="$HOME/_TODO/$YYYYMMDD-video-import/"
|
||||
mkdir -p "$DST"
|
||||
du -sh "$SRC"
|
||||
rsync -ah --no-inc-recursive --info=progress2 --remove-source-files "$SRC"/ $DST/
|
||||
cd "$DST"
|
||||
#mv */* .
|
||||
f2 -r '{{mtime.YYYY}}/{{mtime.YYYY}}-{{mtime.MM}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}.{{f}}.{{hash.sha256}}{{ext}}' -x --verbose
|
||||
}
|
||||
|
||||
function main() {
|
||||
# FIXME this doesn't work if there are no photos on the card but the
|
||||
# DCIM dir exists
|
||||
downloadPhotos
|
||||
downloadVideos
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
44
photoimport/videoimport
Normal file
44
photoimport/videoimport
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env zsh
|
||||
set -x
|
||||
set -e
|
||||
set -o nullglob
|
||||
|
||||
YYYYMMDD="$(date "+%Y-%m-%d")"
|
||||
DST="$HOME/_TODO/$YYYYMMDD-video-import"
|
||||
RSYNCOPTS="-ah --no-inc-recursive --info=progress2"
|
||||
LASDST="root@las1:/srv/las1/video"
|
||||
|
||||
function downloadVideos() {
|
||||
SRC=(/Volumes/*/PRIVATE/M4ROOT/CLIP)
|
||||
if [[ ! -d "$SRC" ]]; then
|
||||
echo "no videos" > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -n "$(ls -A "$SRC" 2>/dev/null)" ]]; then
|
||||
echo "no videos" > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$DST"
|
||||
du -sh "$SRC"
|
||||
rsync \
|
||||
-ah --no-inc-recursive --info=progress2 \
|
||||
--remove-source-files "$SRC"/ $DST/
|
||||
cd "$DST"
|
||||
#mv */* .
|
||||
f2 -r '{{mtime.YYYY}}/{{mtime.YYYY}}-{{mtime.MM}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}.{{f}}.{{hash.sha256}}{{ext}}' -x --verbose
|
||||
}
|
||||
|
||||
function amLocalToLAS1() {
|
||||
ifconfig | grep 10.100.205 | wc -l
|
||||
}
|
||||
|
||||
|
||||
function main() {
|
||||
# FIXME this doesn't work if there are no photos on the card but the
|
||||
# DCIM dir exists
|
||||
downloadVideos
|
||||
}
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user