latest versions
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user