Sobes.tech
Junior — Middle

Do you have experience using the Bash shell for automation or scripting tasks?

sobes.tech AI

Answer from AI

Yes, I have experience using Bash for automating various tasks. For example, I have written scripts for automatic file backups, application deployment, and system monitoring. Bash allows for quick creation of scripts that execute a sequence of commands, process files, and manage processes.

Here's a simple script example for backing up a directory:

#!/bin/bash
SOURCE_DIR="/home/user/data"
BACKUP_DIR="/home/user/backup"

mkdir -p "$BACKUP_DIR"
tar -czf "$BACKUP_DIR/backup_$(date +%F).tar.gz" "$SOURCE_DIR"

This script creates an archive with the current date, which is convenient for regular backups.