Advertisement

Shell Script Code For File Backup Script

Linux Shell Script For File Backup Script 

File Backup Script:

#!/bin/bash

backup_dir="/path/to/backup"

source_dir="/path/to/source"

# Create a timestamped backup of the source directory

tar -czf "$backup_dir/backup_$(date +%Y%m%d_%H%M%S).tar.gz"

"$source_dir"

Post a Comment

0 Comments