Started visual gallery, expanded fetch-script

This commit is contained in:
2022-01-24 00:22:14 +01:00
parent fb5b66f12b
commit a500b5eecc
6 changed files with 166 additions and 4 deletions

View File

@@ -1,10 +1,14 @@
#!/usr/bin/env bash
outfolder="bilder/pvv-photos"
folders=$(find /home/pvv -maxdepth 3 -name 'pvv-photos' 2>/dev/null)
unamefile="usernames.txt"
> $unamefile # Empty the file
for imgfolder in $folders; do
user=$(echo $imgfolder | cut -d "/" -f5)
realname="$(getent passwd $user | cut -d ':' -f 5)"
echo "$user:$realname" >> $unamefile
destination="$outfolder/$user"
mkdir -p $destination
rsync -rvz --delete "$imgfolder/" "$destination"
rsync -rtvz --delete "$imgfolder/" "$destination" # Copy and keep timestamps
done