A command-line tool to back up and restore Linux system configurations, clean up unnecessary files, and schedule automatic maintenance at system startup. Works on any major Linux distribution.
BRCS is an acronym for Backup, Restoration, Cleaner and Schedule.
- Configuration files under
/etc/(.conf,.ini,.rules) - User dotfiles (
.bashrc,.zshrc,.vimrc,.gitconfig,.tmux.conf, etc.) - Crontabs and
/etc/cron.d - Systemd custom units (
.service,.timer,.mount,.socket) - SSH configs (
config,authorized_keys,sshd_config) - Firewall rules (iptables, nftables, ufw, firewalld)
- Network configs (NetworkManager, netplan, systemd-networkd)
- System files (
/etc/fstab,/etc/hosts,/etc/hostname,/etc/resolv.conf, etc.) - Package repo configs (detected per distro)
- Shell scripts in
$HOME
- Interactive mode: review diffs and choose per file
- Bulk mode: restore everything at once
- Validates zip integrity before restoring
- Creates a safety backup of existing files before overwriting
- List backup contents without restoring (
--list)
- Update and upgrade system packages
- Clean package manager cache
- Remove orphaned/unused packages
- Clean systemd journal logs (vacuum to 7d / 100MB)
- Remove old kernels (apt, dnf)
- Clean disabled Snap revisions
- Remove unused Flatpak runtimes
- Prune Docker resources
- Clear Steam shader/compat cache
- Clean
/tmpand/var/tmp(skips files in use) - Reports disk space freed at the end
- Dry-run mode to preview without making changes
- Full CLI interface for scripting and automation
- Interactive terminal menu for manual use
- Timestamped color-coded logging (INFO, WARN, ERROR)
- Terminal progress bar for all operations
- Signal trapping for safe temp file cleanup
- Root/sudo check before privileged operations
| Package Manager | Distributions |
|---|---|
apt |
Debian, Ubuntu, Linux Mint, Zorin OS, Pop!_OS |
dnf |
Fedora, RHEL 9+, CentOS Stream |
yum |
CentOS 7, RHEL 7/8 |
pacman |
Arch Linux, Manjaro, EndeavourOS |
zypper |
openSUSE Tumbleweed/Leap, SLES |
apk |
Alpine Linux |
bash(version 3.2+)zipandunzip
Optional tools (used automatically if available):
locateormlocate/plocate(faster file search; falls back tofind)deborphan,localepurge(Debian-based cleanup)paccache(Arch cache cleanup)flatpak,snap,docker(cleaned if present)lsoforfuser(safe temp file cleanup)diff(interactive restore diffs)
sudo apt install zip unzip mlocatesudo dnf install zip unzip mlocatesudo pacman -S zip unzip mlocatechmod +x BRCS.sh
./BRCS.sh=== BRCS v2.0.0 - System Maintenance ===
1) Backup configurations
2) Restore configurations
3) Full system cleanup
4) Full system cleanup (dry-run)
5) List backup contents
6) Schedule cleanup at boot
7) Exit
# Backup all configurations
./BRCS.sh --backup
# Restore all from a backup file
./BRCS.sh --restore backup.zip
# Restore interactively (review each file)
./BRCS.sh --restore-interactive backup.zip
# List contents of a backup
./BRCS.sh --list backup.zip
# Run full system cleanup
./BRCS.sh --cleanup
# Preview cleanup without making changes
./BRCS.sh --dry-run --cleanup
# Schedule cleanup at boot
./BRCS.sh --schedule
# Show help
./BRCS.sh --helpBackup files are saved as: hostname.confs.YYYYMMDD.zip
Logs are saved to: ~/backup_YYYYMMDD.log
This project is licensed under the terms of the GNU General Public License v3.0.
To run the test suite you need the Bats framework.
Install it via your package manager (e.g. sudo apt install bats) and then execute:
bats test