]> Git — Sourcephile - julm/camera.git/blob - push.sh
index: copy .webm present in src/
[julm/camera.git] / push.sh
1 #!/usr/bin/env bash
2 # Usage:
3 # $ ./push.sh julm/2023
4 cd "${0%/*}"
5 set -eux
6
7 for dir in "$@"; do
8 IFS=/ read -r user year x month x <<<"$dir"
9 test "${user:+set}"
10 test "${year:+set}" || exec "$0" "$user"/*/
11 rsync -ai --no-inc-recursive --info=progress2 --inplace --partial \
12 --copy-dirlinks \
13 --chmod=D755,F644 \
14 --exclude "*.vp9.webm" \
15 --exclude "*.opus" \
16 --exclude "*.uuid" \
17 --delete --delete-after --delete-excluded \
18 "$user"/"$year"/fav/${month:+"$month"/} \
19 mermet.wg:/var/lib/nginx/autogeree.net/"$user"/perso/camera/"$year"/${month:+"$month"/}
20 if test "$(date +%Y)" == "$year"; then
21 ssh mermet.wg ln -sf "$(date +%m)" /var/lib/nginx/autogeree.net/"$user"/perso/camera/"$year"/latest
22 fi
23 done