Skip to content

A versatile Bash-based backup utility that enables efficient full and partial backups of your important files. Designed for simplicity and flexibility, it supports: Full directory backups with compressed archives Pattern-based partial backups (e.g., backup only .txt or .doc files) Automatic creation of backup directories Timestamped backup file

Notifications You must be signed in to change notification settings

Zapwap123/BashScript-File-Backup-System

Repository files navigation

File Backup System

A Bash-based file backup utility that supports full and partial backups with compression. Ideal for archiving important files, automating regular backups, and managing storage efficiently.

Features

  • Full backups of entire directories
  • Partial backups using filename patterns (e.g., *.txt, *report*)
  • Compressed .tar.gz archives
  • Timestamped backups to avoid overwriting
  • Simple to integrate with cron for scheduled backups

Usage

1. Clone the repository:

git clone https://github.com/Zapwap123/BashScript-File-Backup-System
cd BashScript-Automated-File-Sorter

2. Make the script executable:

chmod +x fileBackupSystem.sh

3. Download test files (optional): If you'd like to test the script with pre-made files, run the following script to download test files:

chmod +x downloadTestFilesScript.sh
./downloadTestFilesScript.sh

4. Full Backup:

./fileBackupSystem.sh full <sourceDir> <backupDir>

Example:

mkdir -p full-Backup-Directory
./fileBackupSystem.sh full file-organizer-test/ full-Backup-Directory/

5. Partial Backup (Pattern-based):

./fileBackupSystem.sh partial <sourceDir> <backupDir> <pattern>

Example:

mkdir -p pattern-backup-partial
./fileBackupSystem.sh partial file-organizer-test/ pattern-backup-partial/ "*.txt"

Scheduling Backups (Optional)

Use cron to automate backups:

crontab -e

Example Cron Job:

0 2 * * * /path/to/fileBackupSystem.sh partial /path/to/source /path/to/backup "*.txt" >> /var/log/backup.log 2>&1

Requirements

  • Bash
  • tar
  • Unix-like system (Linux, macOS)

License

MIT License

About

A versatile Bash-based backup utility that enables efficient full and partial backups of your important files. Designed for simplicity and flexibility, it supports: Full directory backups with compressed archives Pattern-based partial backups (e.g., backup only .txt or .doc files) Automatic creation of backup directories Timestamped backup file

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages