From 4f1bdb690e0a8600a00232163adc5975681fcedd Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Sat, 30 Aug 2025 13:24:01 +0100 Subject: [PATCH] Use zstd adapt for backup compression level --- cookbooks/blog/templates/default/backup-staging.cron.erb | 2 +- cookbooks/blog/templates/default/backup.cron.erb | 2 +- cookbooks/blogs/templates/default/backup.cron.erb | 2 +- cookbooks/chef/templates/default/server-backup.cron.erb | 2 +- cookbooks/civicrm/templates/default/backup.cron.erb | 2 +- cookbooks/community/templates/default/backup.cron.erb | 2 +- cookbooks/git/templates/default/backup.cron.erb | 2 +- cookbooks/mailman/templates/default/backup.cron.erb | 2 +- .../mediawiki/templates/default/mediawiki-backup.cron.erb | 4 ++-- cookbooks/otrs/templates/default/backup.cron.erb | 2 +- cookbooks/prometheus/templates/default/backup.cron.erb | 2 +- cookbooks/stateofthemap/templates/default/backup.cron.erb | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cookbooks/blog/templates/default/backup-staging.cron.erb b/cookbooks/blog/templates/default/backup-staging.cron.erb index eaabf3582..1dd834a60 100644 --- a/cookbooks/blog/templates/default/backup-staging.cron.erb +++ b/cookbooks/blog/templates/default/backup-staging.cron.erb @@ -16,7 +16,7 @@ echo 'password=<%= @passwords["osm-blog-staging-user"] %>' >> "$T/mysqldump.opts mysqldump --defaults-file="$T/mysqldump.opts" --opt --no-tablespaces osm-blog-staging > "$T/osm-blog-staging-$D/osm-blog-staging.sql" ln -s /srv/staging.blog.openstreetmap.org "$T/osm-blog-staging-$D/www" -nice tar --create --dereference --directory="$T" --warning=no-file-changed "osm-blog-staging-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" --warning=no-file-changed "osm-blog-staging-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/blog/templates/default/backup.cron.erb b/cookbooks/blog/templates/default/backup.cron.erb index a71169eba..59ff2f8cc 100644 --- a/cookbooks/blog/templates/default/backup.cron.erb +++ b/cookbooks/blog/templates/default/backup.cron.erb @@ -16,7 +16,7 @@ echo 'password=<%= @passwords["osm-blog-user"] %>' >> "$T/mysqldump.opts" mysqldump --defaults-file="$T/mysqldump.opts" --opt --no-tablespaces osm-blog > "$T/osm-blog-$D/osm-blog.sql" ln -s /srv/blog.openstreetmap.org "$T/osm-blog-$D/www" -nice tar --create --dereference --directory="$T" --warning=no-file-changed "osm-blog-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" --warning=no-file-changed "osm-blog-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/blogs/templates/default/backup.cron.erb b/cookbooks/blogs/templates/default/backup.cron.erb index 1397b9b26..d60e95080 100644 --- a/cookbooks/blogs/templates/default/backup.cron.erb +++ b/cookbooks/blogs/templates/default/backup.cron.erb @@ -12,7 +12,7 @@ B="blogs-$D.tar.zst" mkdir "$T/blogs-$D" sqlite3 /srv/blogs.openstreetmap.org/planet.db ".backup $T/blogs-$D/planet.db" -nice tar --create --dereference --directory="$T" "blogs-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" "blogs-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/chef/templates/default/server-backup.cron.erb b/cookbooks/chef/templates/default/server-backup.cron.erb index 82b9f4854..82d15d517 100644 --- a/cookbooks/chef/templates/default/server-backup.cron.erb +++ b/cookbooks/chef/templates/default/server-backup.cron.erb @@ -15,7 +15,7 @@ chmod g+rwx "$T" "$T/chef-server-$D" sudo -u opscode-pgsql /opt/opscode/embedded/bin/pg_dumpall --file="$T/chef-server-$D/chef.dmp" --clean ln -s /var/opt/opscode/bookshelf/data "$T/chef-server-$D/bookshelf" -nice tar --create --dereference --directory="$T" "chef-server-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" "chef-server-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/civicrm/templates/default/backup.cron.erb b/cookbooks/civicrm/templates/default/backup.cron.erb index a071e9b99..bba562483 100644 --- a/cookbooks/civicrm/templates/default/backup.cron.erb +++ b/cookbooks/civicrm/templates/default/backup.cron.erb @@ -16,7 +16,7 @@ echo 'password=<%= @passwords["database"] %>' >> "$T/mysqldump.opts" mysqldump --defaults-file="$T/mysqldump.opts" --opt --skip-lock-tables --no-tablespaces civicrm > "$T/osmf-crm-$D/civicrm.sql" ln -s /srv/supporting.openstreetmap.org "$T/osmf-crm-$D/www" -nice tar --create --dereference --directory="$T" "osmf-crm-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" "osmf-crm-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/community/templates/default/backup.cron.erb b/cookbooks/community/templates/default/backup.cron.erb index 5a7285d74..9bb0a9fd3 100644 --- a/cookbooks/community/templates/default/backup.cron.erb +++ b/cookbooks/community/templates/default/backup.cron.erb @@ -15,7 +15,7 @@ ln -s /srv/community.openstreetmap.org/shared/web-only "$T/community-$D/shared-w ln -s /srv/community.openstreetmap.org/shared/data/redis_data "$T/community-$D/shared-data-redis_data" ln -s /srv/community.openstreetmap.org/shared/data/postgres_backup "$T/community-$D/shared-data-postgres_backup" -nice tar --create --numeric-owner --dereference --directory="$T" --warning=no-file-changed "community-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --numeric-owner --dereference --directory="$T" --warning=no-file-changed "community-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/git/templates/default/backup.cron.erb b/cookbooks/git/templates/default/backup.cron.erb index 419b0faed..fcfe6829f 100644 --- a/cookbooks/git/templates/default/backup.cron.erb +++ b/cookbooks/git/templates/default/backup.cron.erb @@ -11,7 +11,7 @@ B="git-$D.tar.zst" ln -s /var/lib/git "$T/git-$D" -nice tar --create --dereference --directory="$T" "git-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" "git-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/mailman/templates/default/backup.cron.erb b/cookbooks/mailman/templates/default/backup.cron.erb index 77e9b46e9..8f1452dd9 100644 --- a/cookbooks/mailman/templates/default/backup.cron.erb +++ b/cookbooks/mailman/templates/default/backup.cron.erb @@ -17,7 +17,7 @@ nice tar --create --dereference \ --warning=no-file-removed \ --exclude='*/archives/*.txt.gz' \ --directory="$T" \ - "lists-$D" | nice zstd --quiet --rsyncable -o "$T/$B" + "lists-$D" | nice zstd --quiet --adapt--rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup diff --git a/cookbooks/mediawiki/templates/default/mediawiki-backup.cron.erb b/cookbooks/mediawiki/templates/default/mediawiki-backup.cron.erb index 82eaff96d..d90f7f4a5 100755 --- a/cookbooks/mediawiki/templates/default/mediawiki-backup.cron.erb +++ b/cookbooks/mediawiki/templates/default/mediawiki-backup.cron.erb @@ -13,7 +13,7 @@ mkdir "$T/wiki-<%= @name %>-$D" echo '[mysqldump]' > "$T/mysqldump.opts" echo 'user=<%= @database_params[:username] %>' >> "$T/mysqldump.opts" echo 'password=<%= @database_params[:password] %>' >> "$T/mysqldump.opts" -mysqldump --defaults-file="$T/mysqldump.opts" --opt --skip-lock-tables --single-transaction --no-tablespaces "<%= @database_params[:name] %>" | zstd --quiet --rsyncable -o "$T/wiki-<%= @name %>-$D/wiki.sql.zst" +mysqldump --defaults-file="$T/mysqldump.opts" --opt --skip-lock-tables --single-transaction --no-tablespaces "<%= @database_params[:name] %>" | zstd --quiet --adapt --rsyncable -o "$T/wiki-<%= @name %>-$D/wiki.sql.zst" ln -s "<%= @directory %>" "$T/wiki-<%= @name %>-$D/www" nice tar --create --dereference --directory="$T" --warning=no-file-changed --warning=no-file-removed \ @@ -21,7 +21,7 @@ nice tar --create --dereference --directory="$T" --warning=no-file-changed --war --exclude="wiki-<%= @name %>-$D/www/w/.git" \ --exclude="wiki-<%= @name %>-$D/www/w/extensions/*/.git" \ --exclude="wiki-<%= @name %>-$D/www/dump" \ - "wiki-<%= @name %>-$D" | nice zstd --quiet --rsyncable -o "$T/$B" + "wiki-<%= @name %>-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/otrs/templates/default/backup.cron.erb b/cookbooks/otrs/templates/default/backup.cron.erb index bc12848fa..2fa11f6e8 100644 --- a/cookbooks/otrs/templates/default/backup.cron.erb +++ b/cookbooks/otrs/templates/default/backup.cron.erb @@ -16,7 +16,7 @@ sudo -u otrs pg_dump --file="$T/otrs-$D/otrs.dmp" otrs ln -s /var/lib/otrs "$T/otrs-$D/otrs-var" ln -s /etc/apache2/sites-available/otrs.openstreetmap.org.conf "$T/otrs-$D/apache2-otrs.openstreetmap.org.conf" -nice tar --create --dereference --directory="$T" "otrs-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" "otrs-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/prometheus/templates/default/backup.cron.erb b/cookbooks/prometheus/templates/default/backup.cron.erb index 93da842a1..ed581d09e 100644 --- a/cookbooks/prometheus/templates/default/backup.cron.erb +++ b/cookbooks/prometheus/templates/default/backup.cron.erb @@ -14,7 +14,7 @@ mkdir "$T/prometheus-$D" ln -s /var/lib/prometheus/alertmanager "$T/prometheus-$D/alertmanager" ln -s /var/lib/grafana "$T/prometheus-$D/grafana" -nice tar --create --dereference --directory="$T" "prometheus-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" "prometheus-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" diff --git a/cookbooks/stateofthemap/templates/default/backup.cron.erb b/cookbooks/stateofthemap/templates/default/backup.cron.erb index 055e810d6..e221f9694 100644 --- a/cookbooks/stateofthemap/templates/default/backup.cron.erb +++ b/cookbooks/stateofthemap/templates/default/backup.cron.erb @@ -22,7 +22,7 @@ ln -s /srv/2010.stateofthemap.org "$T/sotm-$D/www2010" ln -s /srv/2011.stateofthemap.org "$T/sotm-$D/www2011" ln -s /srv/2012.stateofthemap.org "$T/sotm-$D/www2012" -nice tar --create --dereference --directory="$T" "sotm-$D" | nice zstd --quiet --rsyncable -o "$T/$B" +nice tar --create --dereference --directory="$T" "sotm-$D" | nice zstd --quiet --adapt --rsyncable -o "$T/$B" nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup rm -rf "$T" -- 2.39.5