Advanced Linux Shell Scripting for DevOps Engineers with User management

#90DaysofDevops #Day5

1)Write a bash script which when the script is executed with three given arguments (one is the directory name and second is the start number of directories and the third is the end number of directories ) creates a specified number of directories with a dynamic directory name.

#!/bin/bash
for (( i=$2; i<=$3; i++ ))
do
    mkdir $1$i
done

2) Creating a backup of the scripts

Cron's job is basically for scheduling or running unattended tasks, and Crontab is basically for editing, deleting, and submitting the cron job. It is a file that holds the cron job.

0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
@monthly /home/maverick/bin/tape-backup

3)User management - The user is an entity that can manipulate files and perform several other operations, also it has assigned IDs to it where the root ID is zero and other IDs are assigned up to 999.

sudo useradd username
passwd username
cat /etc/passwd