Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit days at webcam download #186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

the-infinity
Copy link
Collaborator

Turns out, that the data source changed the amount of days they offer, which ended up into deleting and redownloading all files older then 7 days all the time, which again blocked necessary ports. This MR prevents this.

@the-infinity the-infinity requested a review from hbruch February 20, 2025 10:51
@the-infinity the-infinity force-pushed the limit-days-at-webcam-download branch from 07e42b8 to 6a8336a Compare February 20, 2025 10:54
@@ -8,5 +8,7 @@ set -x
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
# Download all new files. Limit to now -(DOWNLOAD_MAX_DAYS - 1) days, otherwise we would delete and re-download data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate a bit more? Is this because because now - 6 days effectively describes a time span of 7 days because the calculation is only precise to the day?

@@ -8,5 +8,7 @@ set -x
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
# Download all new files. Limit to now -(DOWNLOAD_MAX_DAYS - 1) days, otherwise we would delete and re-download data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Download all new files. Limit to now -(DOWNLOAD_MAX_DAYS - 1) days, otherwise we would delete and re-download data
# Download all new files. Limit to now -(IPL_WEBCAM_KEEP_DAYS - 1) days, otherwise we would delete and re-download data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants