[HN Gopher] A backup rotation filter for the Unix shell
       ___________________________________________________________________
        
       A backup rotation filter for the Unix shell
        
       Author : closeneough
       Score  : 73 points
       Date   : 2020-02-28 07:25 UTC (1 days ago)
        
 (HTM) web link (git.sr.ht)
 (TXT) w3m dump (git.sr.ht)
        
       | inshadows wrote:
       | FYI the interface format seems to be inspired by borg-prune[1].
       | 
       | [1] https://borgbackup.readthedocs.io/en/stable/usage/prune.html
        
       | aquabeagle wrote:
       | tarsnap desperately needs something like this included with it.
        
         | closeneough wrote:
         | I also was missing such a feature. That's why I build this.
        
       | FrancoisBosun wrote:
       | Similar concept, in Ruby, acting as a filter in a pipeline, by
       | me:
       | 
       | https://github.com/francois/surrender
        
       | yjftsjthsd-h wrote:
       | Handy looking tool:)
       | 
       | Meta: I'm excited to see sr.ht starting to pop up in the wild
       | like this:) I hope this is part of it starting to take off.
        
         | juped wrote:
         | It's very refreshing not to have some web 7.0 (or whatever
         | we're up to now) site trying to "engage" me when all I want is
         | to look at a source code repository.
        
         | brobot182 wrote:
         | The layout, at least on mobile, could use some work
        
           | leni536 wrote:
           | What problems do you find? I can't find any.
        
             | brobot182 wrote:
             | It plain looks bad. But also, it requires more scrolling to
             | get to the meat of the project
        
       | bArray wrote:
       | If anybody else is using a similar method, I think it's also good
       | to encrypt the backups:                   tar -zcv <SRC_BACKUP> |
       | gpg -c --batch --passphrase <PASSWORD> -o <DEST_BACKUP>.gz.gpg
       | 
       | In my experience the encryption part doesn't add any extra time
       | on a modern machine, with the spinning disk being the slowest
       | cog.
        
         | NieDzejkob wrote:
         | There's a lot of complexity in gpg that's unnecessary for this
         | usecase, I'd use age instead.
         | 
         | https://age-encryption.org/
        
           | voidmain wrote:
           | gpg is widely agreed to be a train wreck, but age is not
           | generally suitable for encrypted backups because it doesn't
           | offer any form of authentication (so an attacker can replace
           | a backup with a malicious one).
        
       | adrianmonk wrote:
       | > _To list backups that will should be kept use the --invert
       | option._
       | 
       | May I suggest changing the name to something more direct? Calling
       | it "--invert" means the user must think through what the default
       | sense of the test is, then negate that in their mind. Not exactly
       | a tough mental task, but people do make careless errors.
       | 
       | Perhaps something like "--list=keep" and "--list=discard" (with
       | the default being "discard").
       | 
       | Also, typos:
       | 
       | "will make prunef to keep" --> "will make prunef keep"
       | 
       | "list backups that will should be" --> "list backups that should
       | be"
        
       | usr1106 wrote:
       | The original title reads "... for your Unix shell", suggesting
       | that the code is portable to many shells. I have not verified
       | that claim.
       | 
       | "... for the Unix shell" makes little sense. When I used Unix my
       | shell was csh, later tcsh. Nowadays my shell is bash in most
       | cases and dash in some more limited environments. Either case,
       | "the Unix shell" does not exist.
        
       | djsumdog wrote:
       | This is awesome. I currently use duplicity for backups to
       | BackBlaze, but my DB backups I just place a files and I've just
       | been pruning old one's manually for a while. Something like this,
       | that lets me specify the file format, would be perfect!
        
       | speedgoose wrote:
       | I use rotate-backups with temporary files and your script is an
       | interesting alternative.
       | 
       | https://pypi.org/project/rotate-backups/
        
       | anonsivalley652 wrote:
       | PSA: Be sure to test every backup completely before succeeding a
       | backup job, or it's not a backup.
        
       ___________________________________________________________________
       (page generated 2020-02-29 23:00 UTC)