Day 5 - Advanced Linux Shell Scripting for DevOps Engineers with User management

TASK1:- ⭐You have to do the same using Shell Script i.e using either Loops or command with start day and end day variables using arguments.

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

☀To run the script, use the following commands:

Task2:-Create a Script to backup all your work done till now.

Creating a script to backup your work is a good practice to ensure that your important files are safe and secure. Here is an example of a simple script that can be used to back up your work:

what is cron and crontab? what the purpose of using these in the script?

Cron is a time-based job scheduler in Unix-like systems. It allows users to schedule jobs (commands or scripts) to run periodically.

Crontab is a file that contains a list of cron jobs. It is a text file that is typically located in the /etc/cron.d/ directory for system-wide jobs or in the .crontab directory in the user's home directory for user-specific jobs.

Purpose of using cron and crontab in scripts:

Cron and crontab can be used to automate a wide variety of tasks, such as:

  • Backing up files and databases

  • Running system maintenance tasks

  • Sending email notification

  • Generating reports

  • Processing data

  • Deploying software updates

    Create 2 users and just display their Usernames

0
Subscribe to my newsletter

Read articles from Pradeep chitroliya directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pradeep chitroliya
Pradeep chitroliya

Hey there! I am Pradeep Chitroliya I am a Devops engineer, started writing articles on my DevOps and cloud journey. My purpose is to share the concepts that I learn, the projects that I build, and the tasks that I perform regarding DevOps. Hope you all find it useful.