From 0fc6be67576b6b3394604c01e29356ac604cbb4a Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Thu, 10 Apr 2025 13:25:07 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=20RE?= =?UTF-8?q?ADME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 15be1bb..0bc0332 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,57 @@ -# backup +# 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`) +- SSH access to NAS + +## Installation +```bash +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: +```bash +./backup.sh +``` +Example: +```bash +./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 +```