https://github.com/foiovituh/bakpak
Ridiculously simple Bash script to automate folder backups 💾
https://github.com/foiovituh/bakpak
automatic-backups backup backup-scheduler backup-script backup-tool backup-utility bash-script cli-script compress-files cron crontab shell-script snapshot targz
Last synced: about 1 month ago
JSON representation
Ridiculously simple Bash script to automate folder backups 💾
- Host: GitHub
- URL: https://github.com/foiovituh/bakpak
- Owner: foiovituh
- License: mit
- Created: 2025-06-28T13:16:12.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-08T22:36:54.000Z (11 months ago)
- Last Synced: 2025-07-08T23:33:52.936Z (11 months ago)
- Topics: automatic-backups, backup, backup-scheduler, backup-script, backup-tool, backup-utility, bash-script, cli-script, compress-files, cron, crontab, shell-script, snapshot, targz
- Language: Shell
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💾 BakPak


> 🧠 A lightweight Bash script for timestamped directory backups — easy to automate with cron.

## 📦 Installation
```bash
git clone https://github.com/foiovituh/bakpak.git
cd bakpak
chmod +x bakpak.sh
sudo ln -s "$PWD/bakpak.sh" /usr/local/bin/bakpak
```
## 🚀 Usage
### Required:
```bash
-f Directory to back up (must be readable)
-t Directory to store the compressed archive (must be writable)
```
### Optional:
```bash
-v Show script version
-h Show a help message
-u Uncompressed mode - create a .tar without gzip compression
-d Dry-run mode — no backups will be created, only displayed
-c Schedule backup as a cron job using the specified cron expression
```
### Examples:
- Basic backup (compressed):
```bash
bakpak -f ~/Documents -t /mnt/docs_backup
```
- Dry-run (no files created):
```bash
bakpak -f ~/Tests -t /mnt/backup_simulations -d
```
- Cron job (1st day of month at 17:00):
```bash
bakpak -f /home/user/folder -t /mnt/backups -c "0 17 1 * *"
```
- Uncompressed backup with custom name:
```bash
bakpak -f ~/projects/president -t /mnt/d/band -p uncompressed_site_project -u
```
## ⏰ Cron Scheduling
Use the `-c` option with a valid [cron expression](https://crontab.guru) (e.g., `0 17 1 * *`) to schedule automatic backups.
Make sure both `-f` (from) and `-t` (to) arguments use **absolute paths** (starting with `/`) so cron runs correctly.
## 🔍 Logs
All backup activity is automatically logged:
| Type | Path |
|------------|-------------------------------------------|
| ✅ Success | `~/.bakpak/logs/successes.log` |
| ❌ Error | `~/.bakpak/logs/errors.log` |
## ⭐ Support the Project
If you like this project or find it useful, please give it a star! It helps with visibility and motivates continued development.
## 📄 License
Distributed under the MIT License. See [`LICENSE`](LICENSE) for more information.