Skip to content

foiovituh/bakpak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ύ BakPak

GitHub License GitHub Release

🧠 A lightweight Bash script for timestamped directory backups β€” easy to automate with cron.

Image

πŸ“¦ Installation

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:

-f <path>    Directory to back up (must be readable)
-t <path>    Directory to store the compressed archive (must be writable)

Optional:

-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 <expr>    Schedule backup as a cron job using the specified cron expression

Examples:

  • Basic backup (compressed):
bakpak -f ~/Documents -t /mnt/docs_backup
  • Dry-run (no files created):
bakpak -f ~/Tests -t /mnt/backup_simulations -d
  • Cron job (1st day of month at 17:00):
bakpak -f /home/user/folder -t /mnt/backups -c "0 17 1 * *"
  • Uncompressed backup with custom name:
bakpak -f ~/projects/president -t /mnt/d/band -p uncompressed_site_project -u

⏰ Cron Scheduling

Use the -c option with a valid cron expression (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 for more information.