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

cronjonb: simplify hugo cronjob by using rsync #1331

Merged
merged 4 commits into from
Feb 20, 2025

Conversation

neteler
Copy link
Member

@neteler neteler commented Feb 19, 2025

This PR simplifies the hugo cronjob by using rsync:

  • avoids need of tmp-dir
  • reduces rm/cp operations to single rsync call
  • include header

In tests on grass.osgeo.org this modified script needs approx 80% of the time the original script required.

This PR simplifies the hugo cronjob by using rsync:

- avoids need of tmp-dir
- reduces rm/cp operations to single rsync call
@neteler neteler added enhancement New feature or request CI Continuous integration labels Feb 19, 2025
@neteler neteler self-assigned this Feb 19, 2025
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

The rsync is indeed much more readable and cutting some time is nice.

ln -s /var/www/code_and_data/* /var/www/html/ && \
rmdir /var/www/html_new && \
(cd /var/www/html/ ; /home/neteler/bin/fix_link_timestamp.sh .)
(cd /var/www/html/ ; /home/neteler/bin/fix_link_timestamp.sh .) && \
Copy link
Member

Choose a reason for hiding this comment

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

Not directly related to this PR, but is the timestamp fixing needed? I don't see the script in this repo. Maybe you have a comment there?

Copy link
Member Author

Choose a reason for hiding this comment

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

It has been my (personal) policy to not damage timestamps when copying over files. I tried to carefully keep the server timestamps since the late 1990s :-) Random example: https://grass.osgeo.org/grass42/source/

The fix_link_timestamp.sh script I can add to this PR if desired.

Copy link
Member

Choose a reason for hiding this comment

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

Lovely. Can you put there a comment that his makes the time stamps of the symlinks the same as time stamps of the original files? (If that's what this is doing.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Time stamp restore function included in 9963b61

@wenzeslaus
Copy link
Member

Maybe we can merge it around the same time as #1330 and you can watch if the server explodes due to either of those PRs.

@neteler
Copy link
Member Author

neteler commented Feb 20, 2025

I have already tested the latest PR version on grass.osgeo.org. Appears to successfully work.

Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

Perfect!

@neteler neteler merged commit a5ff8c1 into OSGeo:grass8 Feb 20, 2025
7 checks passed
@neteler neteler deleted the simplify_hugo_clean_and_update_job branch February 20, 2025 11:24
@neteler
Copy link
Member Author

neteler commented Feb 20, 2025

The updated script is now in place on the server.
Let's watch if anything goes wrong on https://grass.osgeo.org/ in the next 24 hs...

@wenzeslaus
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants