Skip to content

Commit

Permalink
further improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
the-infinity committed Dec 3, 2024
1 parent 8f29fff commit 7eadae8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/download_webcams.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ set -eo pipefail
set -x

1>&2 echo 'Downloading webcam images'
lftp -e "mirror -c --parallel=$IPL_WEBCAM_WORKER --verbose / /var/webcam; quit;" -u $IPL_WEBCAM_USER,$IPL_WEBCAM_PASSWORD $IPL_WEBCAM_SERVER
# Delete all old webcam images
find /var/webcam -mtime +$IPL_WEBCAM_KEEP_DAYS -type f -name '*.jpg' -delete
find /var/webcam -mtime +$IPL_WEBCAM_KEEP_DAYS -type f -delete
# Delete all empty directories
find /var/webcam -type d -empty -delete
# Download all new files
lftp -e "mirror -c --parallel=$IPL_WEBCAM_WORKER --verbose / /var/webcam; quit;" -u $IPL_WEBCAM_USER,$IPL_WEBCAM_PASSWORD $IPL_WEBCAM_SERVER

0 comments on commit 7eadae8

Please sign in to comment.