説明なし

Denis V. Dedkov 7de816c870 Добавлен скрипт для восстановления из бэкапа 9 ヶ月 前
LICENSE 2c0ce6715d Initial commit 10 ヶ月 前
README.md bf9362bf30 Обновить 'README.md' 10 ヶ月 前
backup.sh 50ed8e8455 Убран verbose из лога 10 ヶ月 前
restore.sh 7de816c870 Добавлен скрипт для восстановления из бэкапа 9 ヶ月 前

README.md

NAS Backup Script

A Bash script for automated backup to NAS using rsync with include/exclude patterns.

Features

  • ✅ Syncs files/folders to NAS
  • ✅ Supports include/exclude lists
  • ✅ Verifies NAS connection
  • ✅ Preserves directory structure
  • ✅ Detailed logging

Requirements

  • Linux/Unix system
  • rsync on both client and NAS
  • sshpass installed (sudo apt install sshpass)

Installation

git clone https://gogs.dended.ru/ded/backup
cd backup
chmod +x backup.sh

Configuration

Create config files: backup_list.txt (files/folders to backup):

/home/user/Documents
/etc/nginx
~/projects

exclude_list.txt (patterns to exclude):

*.tmp
*.log
/home/user/Documents/temp/

Usage

Basic command:

./backup.sh <NAS_IP> <USER> <PASSWORD> <BACKUP_LIST> <EXCLUDE_LIST>

Example:

./backup.sh 192.168.1.100 admin mypass ~/backup_list.txt ~/exclude.txt

Scheduling with Cron

Hourly backup with logging:

0 * * * * /path/to/script.sh 192.168.1.100 admin pass /backup_list.txt /exclude.txt >> /var/log/nas_backup.log 2>&1