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.
- 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
git clone https://github.com/Zapwap123/BashScript-File-Backup-System
cd BashScript-Automated-File-Sorter
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
./fileBackupSystem.sh full <sourceDir> <backupDir>
mkdir -p full-Backup-Directory
./fileBackupSystem.sh full file-organizer-test/ full-Backup-Directory/
./fileBackupSystem.sh partial <sourceDir> <backupDir> <pattern>
mkdir -p pattern-backup-partial
./fileBackupSystem.sh partial file-organizer-test/ pattern-backup-partial/ "*.txt"
Use cron
to automate backups:
crontab -e
0 2 * * * /path/to/fileBackupSystem.sh partial /path/to/source /path/to/backup "*.txt" >> /var/log/backup.log 2>&1
- Bash
- tar
- Unix-like system (Linux, macOS)
MIT License