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 +```