Git Product home page Git Product logo

heptapod's Introduction

heptapod

This is a command line application to manage and fine-tune Time Machine exclude paths.

Why it is named after creatures from Arrival? Heptapods are extraterrestrial species from the movie Arrival. They are special because they have non-linear time perspective. Their written language (Heptapod B) is basically describes the future and the past in the same time. Hence the name of the tool.

Install

brew tap tg44/heptapod
brew install heptapod

Usage

To print help;

heptapod -h
heptapod <action> -h

Move (and use) the default ruleset;

mkdir -p ~/.heptapod/rules
cp -R $(brew --prefix heptapod)/rules ~/.heptapod

Lists all the rules (you get 4 tables, enabled, disabled, parseable but unrunable and unparsable).

heptapod rules ls -a

Enable/disable rules (by name), or add/remove ignore folders;

heptapod rules disable node bower
heptapod rules enable bower
heptapod rules ignoreAdd ~/.Trash ~/.yarn/cache ~/Library
heptapod rules ignoreRemove ~/.Trash

List all the currently excluded TM paths;

heptapod tm ls

Dryrun the current rules, in verbose mode, also log speed and debug informations. (Potentially list nonexistent directories and files!)

heptapod -v run -d

To run the current rules, and add the dirs to the TM exclude list. Also writes exclude logs to ~/.heptapod/logs (or the given --logDir dir) for easier revert.

heptapod run

To revert all the previously added paths from the run-exclude-logs. (prune -h could tell you the other useful revert options).

heptapod prune -a

Notes for TM migrating to a new machine

When you try to migrate your TM state to a new machine xcode-select --install may be needed. Somehow this is sometimes not migrating as you thought it will.

Rules

Every rule has a searchPaths, ignorePaths.

  • name for categorization
  • enabled for easier enable/disable
  • searchPaths are the root of the rule search like ~
  • ignorePaths are subpaths that we want to ignore to make the run quicker
    • like we want to parse dirs under ~, but not ~/Downloads
  • type is the ruletype
    • file-trigger
    • regexp
    • ignore-files
  • settings other type setting see below

Ignore (not yet implemented)

Parses the .gitignore or .dockerignore files, and excludes its contents.

  • forceAddPaths are files that we add even if they would be otherwise excluded
    • like .gitignore ignores .env files but we forcefully want to add them back
  • fileName
    • .gitignore or .dockerignore

Regexp (not yet implemented)

Ignores all files/folders with the given regexp. This can be slow!

  • regexp

File trigger

Ignores files/dirs based on other files existence, made for easy language dep ignores.

  • fileTrigger like package.json or .git
  • excludePaths like node-modules or .

Credits

Contribution

If you are interested in this repo, star it, and write an issue, and we can talk about future ideas there!

Repo/developement state

done:

  • architecture the protocol/configs
  • most of asimov's features are ported
  • example rules added
  • command line interface
  • option to dryrun, show inner states, write to file
  • purge option
    • we should write down what paths excluded by us, and include them back
  • brew package
  • ghactions
  • rule manage commands (list/enable/disable/ignoreAdd/ignoreRemove)

todos:

  • handle global deps (m2, ivy, nvm, npm)
  • support tmignore functionality
  • support tmignore like funcionality with dockerignore
  • regexp pattern
  • hook to rerun periodically/before tmbackups
  • port asimov's issues (spotify, spotlight)
  • docker support (at least tell if docker vm is persisted or not)
    • this is kinda easy with tmutil.GetExcludeList()
  • android vms?
    • this should be also easy
  • preemptive search that tells you how many files with which size will be excluded/included
    • nice to have, we can tell the sizes, but counting files need to actually count the files which could be slow AH
  • speedtest it
  • modify the backup intervals and frequencies
    • not sure it can be done with tmutil, but there are applications for this
  • probably adding . and .. will break the execution shortcuts and need to fix them
  • wildcards like *.sh not working right now, do we want to make them work?

heptapod's People

Contributors

tg44 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.