Script for fetching pictures from home folders

This commit is contained in:
Felix Albrigtsen 2022-01-23 01:34:48 +01:00
parent e7f9799285
commit fb5b66f12b
2 changed files with 12 additions and 1 deletions

3
.gitignore vendored
View File

@ -6,4 +6,5 @@
/www/simplesaml /www/simplesaml
composer.phar composer.phar
/www/galleri/bilder/slideshow/*.* /www/galleri/bilder/slideshow/*.*
!/www/galleri/bilder/slideshow/.gitkeep !/www/galleri/bilder/slideshow/.gitkeep
/www/galleri/bilder/pvv-photos/*.*

10
www/galleri/fetchPics.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
outfolder="bilder/pvv-photos"
folders=$(find /home/pvv -maxdepth 3 -name 'pvv-photos' 2>/dev/null)
for imgfolder in $folders; do
user=$(echo $imgfolder | cut -d "/" -f5)
destination="$outfolder/$user"
mkdir -p $destination
rsync -rvz --delete "$imgfolder/" "$destination"
done