From c7d7b1db3c9092e8d848642dab7b4760ed2e1bd5 Mon Sep 17 00:00:00 2001 From: "taha@asks2" Date: Mon, 12 Oct 2020 01:43:11 +0200 Subject: [PATCH] rsync line was using poor syntax. Fixed. asterisk in rsync source was wrong, removed. exclude path should not be absolute but relative to source, fixed. My change of var path_wd to path_thesis was done on a whim, hope it doesn't make anything worse --- chertex.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chertex.sh b/chertex.sh index 55f5ba8..768f980 100755 --- a/chertex.sh +++ b/chertex.sh @@ -186,15 +186,15 @@ if [ $# -eq 1 ]; then # rsync can't do that. We need to use a different tool. See e.g. # https://superuser.com/questions/260092/rsync-switch-to-only-compare-timestamps # copy only the "large" photos that have file modtimes more recent than the last time this operation was run - photoslastrun="$path_wd/assets/photos/.lowres/lastrun" + photoslastrun="$path_thesis/assets/photos/.lowres/lastrun" if [ ! -f "$photoslastrun" ]; then # if, for some reason, the lastrun file does not exist # copy over everything and then create the file - rsync -av "$path_wd/assets/photos/*" "$path_wd/assets/photos/.lowres/" --exclude "$path_wd/assets/photos/.lowres/" + rsync -av "$path_thesis/assets/photos/" "$path_thesis/assets/photos/.lowres/" --exclude ".lowres/" touch "$photoslastrun" fi # cd and use --parents arg to preserve directory structure in .lowres target - cd "$path_wd/assets/photos" + cd "$path_thesis/assets/photos" newphotos="$(find . -type f -cnewer $photoslastrun ! -path './.lowres/*')" if [ -n "$newphotos" ]; then for newphoto in $newphotos; do @@ -204,7 +204,7 @@ if [ $# -eq 1 ]; then # revert the effects of cd above. Redirect to null suppresses the output. cd - >/dev/null # in the low-res tree, find any photo larger than specific size (500kB) - largephotos="$(find $path_wd/assets/photos/.lowres/ -size +500k)" + largephotos="$(find $path_thesis/assets/photos/.lowres/ -size +500k)" for largephotofilename in $largephotos; do # for the next statement to work reliably, we should probably convert other formats to JPEG # detect file extension, and based on it, convert to jpg using mogrify