]> Git — Sourcephile - julm/camera.git/blob - push.sh
julm/pull: support SD card 6365-3561
[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 rsync -ai --chmod=D755,F644 \
21 "$user"/"$year"/fav/index.css \
22 mermet.wg:/var/lib/nginx/autogeree.net/"$user"/perso/camera/"$year"/
23 if test "$(date +%Y)" == "$year"; then
24 ssh mermet.wg ln -sf "$(date +%m)" /var/lib/nginx/autogeree.net/"$user"/perso/camera/"$year"/latest
25 fi
26 done