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

[feature] Create CACHEDIR.TAG files in media paths that need not be backed up #3658

Open
mirabilos opened this issue Jan 19, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers storage/media Issues related to how we store and serve media

Comments

@mirabilos
Copy link
Contributor

Is your feature request related to a problem ?

https://docs.gotosocial.org/en/latest/admin/backup_and_restore/#borgmatic describes a method to generate patterns for one specific backup software. I would like to propose a more general solution that various backup softwares can support (the one I use does).

Describe the solution you'd like.

Create a file with the exact case-sensitive filename CACHEDIR.TAG and the exact content Signature: 8a477f597d28d172789f06886806bc55 (newline at the end apparently not required, but you can add one and a comment) in each directory whose contents (files and subdirectories) need not to be backed up. (This has no unexclusion method, it’s a recursive exclusion, so I think it needs to be in places like /srv/GtS/01J2PFJKS8KXRY41CV329N5VSK/CACHEDIR.TAG for remote accounts.)

On filesystems supporting hardlinks, these files ought to be hardlinked together so only one inode and data block are used (with over 8k entries in my media storage alone, this is worth it).

On object storage, this is not necessary, do it on real filesystems only.

Describe alternatives you've considered.

Either have too-large backups with redundant data or remember to manually flush remote media before backing up.

Additional context.

No response

@mirabilos mirabilos added the enhancement New feature or request label Jan 19, 2025
@daenney
Copy link
Member

daenney commented Jan 23, 2025

I had never heard of this before, but this looks rather handy. Avoids us having to split up the media store into two, or use other tricks.

From what I can see at least restic and bupstash support it. Borg supports it too with --exclude-caches which would simplify things a lot as we can get rid of most of the docs and the supporting scripts to generate the patterns. Seems its supported this since 2014 so I could've spared myself a lot of time and effort 😅. Seems archive utilities like tar support it too.

@daenney daenney added good first issue Good for newcomers storage/media Issues related to how we store and serve media labels Jan 23, 2025
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc self-assigned this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers storage/media Issues related to how we store and serve media
Projects
None yet
Development

No branches or pull requests

3 participants