#backup #files #cli

app backup_rat

A highly configurable backup tool

16 releases (5 breaking)

0.6.0 Feb 6, 2019
0.4.2 Jan 22, 2019
0.4.1 Dec 1, 2018
0.4.0 Sep 5, 2018
0.2.1 Jul 20, 2018

#27 in #backup

Download history 17/week @ 2021-03-31 17/week @ 2021-04-07 43/week @ 2021-04-14 1/week @ 2021-04-28 17/week @ 2021-05-12 16/week @ 2021-06-09 5/week @ 2021-06-23 4/week @ 2021-06-30 6/week @ 2021-07-07 67/week @ 2021-07-14

58 downloads per month

MPL-2.0 license

455 lines


This document explains the usage of the backup-rat binary


Requires a standard Rust installation (If you dont have it get it here)

Using crates.io

$ cargo install backup_rat

Using git

Clone the project

$ git clone "https://github.com/System-rat/backup-rat.git"

Enter the directory

$ cd backup-rat

Install from the source

$ cargo install --path .


Currently the binary REQUIRES a config file to operate correctly (or not if you don't want any targets but that kinda defeats the purpose).

Backs up all NON-optional targets in the config file

$ backup-rat backup

Backs up all targets with the "Config" tag

$ backup-rat backup Config

Generate the completions for various shells

$ backup-rat completion bash


The config file is located at $HOME/.config/backup-rat/config.toml for *NIX systems or %HOME%/AppData/Roaming/System.rat/backup-rat/config.toml for Windows, $HOME/Library/Preferences/com.System.rat.backup-rat/config.toml for OSX and uses the TOML syntax (basically .ini files)

The config file structure

All of the Optional variables are set to defaults in this example

NYI - Not yet implemented (don't use it, there is no need)

daemon_interval = 0 

color = false 

fancy_text = true 

verbose = false 

runtime_folder = "" 

# This is 1 target, to configure more just put more of these [[target]] tags followed by the target declaration
# Added: 0.1.0

# Optional: the tag for logging and for backing up (must use if the target is optional)
# Added: 0.1.0
tag = "Config"

# The path to the file or folder to backup
# Added: 0.1.0
path = "/etc" 

# The destination of the backup (in this example the /etc folder will be in /mnt/Backup/etc)
# Added: 0.1.0
target_path = "/mnt/Backup" 

# Optional: If set to true the target will NOT be backed up by the *all* target
# Added: 0.1.0
optional = false 

# Optional: If set to true the files will NOT be checked for modification
# Added: 0.1.0
always_copy = false 

# Optional: A list of files to be ignored during backup
# Prefix the string with a r# to use a regex pattern
# If he string is not prefixed with a r# the full filename is evaluated
# Added: 0.3.0
ignore_files = [

# Optional: Same as `ignore_files` except it evaluates the folder path relative
# to the base directory (in example, target: "/home/user/Documents" the sub-folder
# "Rust/backup_rat" gets evaluated as such)
# Added: 0.3.0
ignore_folders = [

# Optional: How many copies of the target to keep (folder targets only).
# The name of the directory to be copied will be put in the backup directory
# followed by `keep_num` number of subdirectories with the date of the backup as
# the name.
# DateTime directories are only created if `keep_num` is greater than 1.
# If `keep_num` is greater than 1, always_copy is ignored as it will always create a new directory.
# Example directory location: /mnt/Backup/etc/2042-2-18 12:00:43/
# Added: 0.4.0
keep_num = 2

# Example of a second target that uses the same tag
tag = "Config"
path = "/home/USERNAME/.config"
target_path = "/mnt/Backup/Config"


~99K SLoC