Preserve mtimes on deploy !2

merged merged by cmc on 2026-08-31 05:35 UTC · cmc/cleberg.net:rsync-preserve-times into main

1 file changed, +4 −1

Layout: unified · split

build.py +4 −1
@@ -178,7 +178,10 @@ def deploy_to_server(build_dir, server, dry_run=False):
178 print(f"{'Would deploy' if dry_run else 'Deploying'} {build_dir}/ → {remote_path}") 178 print(f"{'Would deploy' if dry_run else 'Deploying'} {build_dir}/ → {remote_path}")
179 cmd = [ 179 cmd = [
180 "rsync", 180 "rsync",
181 "-r", 181 "-rt",
182 # -t, or rsync gives every transferred file the time it arrived, no two
183 # deploys agree on a timestamp, and the next run re-sends the whole site
184 # because mtimes never match. With it, only what changed goes over.
182 "--delete-before", 185 "--delete-before",
183 # The build cache lives in the output directory because it describes it, but it 186 # The build cache lives in the output directory because it describes it, but it
184 # is not part of the site. Excluding it also stops --delete removing it locally. 187 # is not part of the site. Excluding it also stops --delete removing it locally.