Merge lp:~cjwatson/turku/turku-storage-preserve-hard-links into lp:turku

Proposed by Colin Watson
Status: Merged
Approved by: Nick Moffitt
Approved revision: 36
Merged at revision: 36
Proposed branch: lp:~cjwatson/turku/turku-storage-preserve-hard-links
Merge into: lp:turku
Diff against target: 25 lines (+4/-0)
2 files modified
turku_storage/ping.py (+2/-0)
turku_storage/utils.py (+2/-0)
To merge this branch: bzr merge lp:~cjwatson/turku/turku-storage-preserve-hard-links
Reviewer Review Type Date Requested Status
Turku Pending
Review via email: mp+374826@code.launchpad.net

Commit message

Add a configuration option to preserve hard links.

Description of the change

This can be expensive, so we shouldn't do it for every source. However, the git service uses hard links when creating subordinate repositories, and not preserving these may cause a significant amount of backup bloat.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 36

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'turku_storage/ping.py'
--- turku_storage/ping.py 2019-05-22 17:35:00 +0000
+++ turku_storage/ping.py 2019-10-29 10:14:53 +0000
@@ -202,6 +202,8 @@
202 rsync_args.append('--link-dest=%s' % os.path.join(snapshot_dir, base_snapshot))202 rsync_args.append('--link-dest=%s' % os.path.join(snapshot_dir, base_snapshot))
203 else:203 else:
204 rsync_args.append('--inplace')204 rsync_args.append('--inplace')
205 if self.config['preserve_hard_links']:
206 rsync_args.append('--hard-links')
205207
206 filter_file = None208 filter_file = None
207 filter_data = ''209 filter_data = ''
208210
=== modified file 'turku_storage/utils.py'
--- turku_storage/utils.py 2019-05-22 17:35:00 +0000
+++ turku_storage/utils.py 2019-10-29 10:14:53 +0000
@@ -188,6 +188,8 @@
188188
189 if 'snapshot_mode' not in config:189 if 'snapshot_mode' not in config:
190 config['snapshot_mode'] = 'link-dest'190 config['snapshot_mode'] = 'link-dest'
191 if 'preserve_hard_links' not in config:
192 config['preserve_hard_links'] = False
191193
192 if 'ssh_ping_host' not in config:194 if 'ssh_ping_host' not in config:
193 config['ssh_ping_host'] = socket.getfqdn()195 config['ssh_ping_host'] = socket.getfqdn()

Subscribers

People subscribed via source and target branches

to all changes: