cutback
Version, currently 0.0.1-pre1 version
- 0.0.1-prelatestMar 5, 2024
github.com/RyanScottLewis/cutback
Backup system with the goal of creating smaller, more focused backups.
Installation
# Add this to your shard.yml
dependencies:
cutback:
github: RyanScottLewis/cutback
version: ~> 0.0.1-preThen run:
shards installshard.yml
- Crystal
1.7.1- License
- MIT
Dependencies
Runtime Dependencies
- logger*github: crystal-lang/logger.cr
- baked_file_system0.10.0github: schovi/baked_file_system
Development Dependencies
- ameba~> 1.3.1github: veelenga/amebadev
README
Cutback
Cutback is a backup system with the goal of creating smaller, more focused backups by generating filtered file lists before archiving and keeping records of easily reaquirable files.
Installation
Manual
$ make
$ sudo make install
# Or
$ sudo make DESTDIR="/" install
Usage
The following will backup all files in the current user's home directory as well as a public
/srv/public directory.
All nodes with the node_modules, .bundle, and .cache name will not be included in the file list
or the archive.
In addition, public Videos directory at any depth will not be included, but will have a record kept
of alongside the archive.
This will cut the archive size down significantly, as the videos can easily be reacquired.
$ cutback --paths '~;/srv/public' --excludes 'node_modules;.bundle;.cache' --records '/srv/public/*/Videos'
Cutback can also be configured from a YAML or JSON file with the --config option:
$ cutback --config backup.yaml
Here is the above configuration options within a YAML file:
Note that paths do not have to be surrounded by quotation marks but every now and then YAML doesn't assume the value is a String, so we stick to surrounding with quotations every time.
backup.yaml
paths: # Paths to search for files
- "~"
- "/srv/public"
excludes: # Paths to exclude from the file list
- "node_modules"
- ".bundle"
- ".cache"
records: # Paths to keep a record of, also excluded from the file list
- "/srv/public/*/Videos"
Strategy
- Search
- Generate manifest
- Generate records
- Archive
- Compress archive
- Generate checksum
- Generate
- Metadata
Search
The first step is to search all paths listed in the paths configuration variable for all files
recursively.
All file patterns listed in the excludes configuration variable are excluded from this search
entirely. File patterns allow for wildcards to be used instead of (or as well as) absolute paths to
exclude whole subtrees of files.
Files matching the file patterns listed in the records configuration variable are added to a list
of files to keep a record of.
Records are usually files that are low priority and easily reaquirable, such as movies, music, tv shows, etc. These files take up a lot of space and generally have a physical backup which means backing them up would be a waste of precious space. This also vastly improves the duration of the backup process, for both archiving and unarchiving.
This list of records is located in the output directory, denoted with a .records suffix.
All other files found within the search, are added to a list in the output directory, called the
manifest, and denoted with a .manifest suffix.
Archive
The manifest of files found in the previous step is now used to create the backup archive.
This archive is optionally compressed and denoted with a .tar[.COMPRESSION] suffix.
A checksum is then generated from the archive.
Generate
Information about the backup is recorded and saved with the suffix appropriate for the format in the
format configuration variable:
- Backup
- Date & time (UTC)
- Search paths
- Duration
- Manifest
- File count
- Total file size
- Archive
- Compression
- Enabled
- Tool (gzip, xz, etc.)
- Flags (passed to the tool)
- Checksum
- Tool (sha256sum, sha512sum, etc.)
- Value
- Size
- Byte count
- Human readable
- Compression
Viewing Progress
If PV is installed, you can pass the --progress/-P option to view the progress of the
current command, if applicable.
Contributing
- Fork it (https://github.com/RyanScottLewis/cutback/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
License
This program is available as open source under the terms of the MIT License http://opensource.org/licenses/MIT.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.0.1-pre- Tagged
- Mar 5, 2024
- Commit
eed41c5ab381- Crystal
1.7.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/RyanScottLewis/cutback
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1