Skip to content

devcode-it/simple-backup-dirs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Backup Directories

A simple bash script to backup multiple directories into compressed ZIP archives with automatic cleanup of old backups.

Features

  • Backup multiple directories in a single run
  • Automatic ZIP compression
  • Date-based backup file naming
  • Automatic cleanup of old backups based on retention policy
  • Configuration file for easy customization

Setup

  1. Copy the example configuration file:

    cp backup_config.cfg.example backup_config.cfg
  2. Edit backup_config.cfg with your specific settings:

    • FOLDERS: Comma-separated list of directories to backup
    • RETENTION_DAYS: Number of days to keep backup files
    • BACKUP_DIR: Directory where backups will be stored
  3. Make sure the backup directory exists and has write permissions:

    mkdir -p /path/to/backup/directory

Usage

Run the backup script:

./backup.sh

The script will create ZIP files named {folder_name}_backup_{YYYY-MM-DD}.zip in your specified backup directory.

Example

If you backup a folder named documents on 2024-01-15, the resulting file will be:

documents_backup_2024-01-15.zip

Requirements

  • bash
  • zip command
  • find command (for cleanup)

License

See LICENSE file for details.

About

Simple backup script for backing up directoryes with retention

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages