# Advanced Linux Shell Scripting for DevOps

| Table of contents: |
| --- |
| 📌 Task - 1: Create Multiple Directories by Passing Arguments 📁📁 |
| 📌 Task - 2: Script to Backup Your Work 📜💾 |
| 📌 Task - 3: What are Cron and Crontab 🕰️🗒️ |
| 📌 Task - 4: User Management in Linux 👥🔧 |
| 📌 Task - 5: Creating Users and Displaying Usernames 👤👤 |

## **📝 Introduction**

This blog will cover the automation of creating multiple directories, the process of taking backups using cron jobs, and the management of users in Linux.

## **📌 Task - 1 Create Multiple Directories by Passing Arguments 📁📁**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1711783234762/dceb8fe7-0ca0-4ff1-8af7-35068cfe71a3.png align="center")

## **📌 Task - 2 Script to Backup Your Work 📜💾**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1712987811139/0c66f6d8-f953-4325-b602-e603795b5a8c.png align="center")

Output:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1712987872204/5b3b9d71-5aa8-4bab-b8c0-c7f4febdee25.png align="center")

## **📌 Task - 3 What are Cron and Crontab 🕰️🗒️**

The **crontab** is a list of commands that you want to run on a regular schedule, and also the name of the command used to manage that list. It allows users to schedule tasks or commands to run at specific intervals or at predefined times. These scheduled tasks are referred to as corn jobs.

* View Root Crontab entries : Login as root user (su – root) and do crontab -l.
    
* To view crontab entries of other Linux users : Login to root and use -u {username} -l.
    
* To edit a crontab entries, use crontab -e. By default this will edit the current logged-in users crontab.
    

Entry in the crontab file to schedule the above script for daily execution at 11:30. /dev/null This refers to the null device, and writing to it is a way to discard the output.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1712993978612/d7df52e5-3031-4a06-b670-06e0c6f371d2.png align="center")

## **📌 Task - 4: User Management in Linux 👥🔧**

User management in Linux involves creating, managing, and controlling user accounts on the system. Each user account represents a separate identity that can access the system's resources, files, and applications.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1712994277349/24d6a9b2-94ba-4642-911b-b4f012bc21ea.png align="center")

## **📌 Task - 5 Creating Users and Displaying Usernames 👤👤**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1712994315046/168967a8-88b7-4e46-bb0f-c3dd0f92baa0.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1712994428648/69f70868-9908-4871-bcdc-fdd93241cda4.png align="center")
