main3.sh 199 B

12345678
  1. #!/bin/bash
  2. backup_dir="/data"
  3. backup_file="/home/backup/backup_$(date +%Y%m%d).tar.gz"
  4. tar -czf "$backup_file" -C "$backup_dir" .
  5. echo "Резервная копия создана: $backup_file"