π§ A lightweight Bash script for timestamped directory backups β easy to automate with cron.
git clone https://github.com/foiovituh/bakpak.git
cd bakpak
chmod +x bakpak.sh
sudo ln -s "$PWD/bakpak.sh" /usr/local/bin/bakpak
-f <path> Directory to back up (must be readable)
-t <path> Directory to store the compressed archive (must be writable)
-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
- 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
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.
All backup activity is automatically logged:
Type | Path |
---|---|
β Success | ~/.bakpak/logs/successes.log |
β Error | ~/.bakpak/logs/errors.log |
If you like this project or find it useful, please give it a star! It helps with visibility and motivates continued development.
Distributed under the MIT License. See LICENSE
for more information.