Task of day5 of 90daysofdevops

ยท

2 min read

Create Directories Using Shell Script:

  • Write a bash script createDirectories.sh that, when executed with three arguments (directory name, start number of directories, and end number of directories), creates a specified number of directories with a dynamic directory name.

  • Example 1: When executed as ./createDirectories.shday 1 90, it creates 90 directories as day1 day2 day3 ... day90.

  • Example 2: When executed as ./createDirectories.shMovie 20 50, it creates 31 directories as Movie20 Movie21 Movie22 ... Movie50.

  • Step 1: Open a Terminal

    First, open your terminal on your Linux system.

    Step 2: Create the Script File

    Create a new shell script file called createDirectories.sh using a text editor. You can use nano or any other editor you prefer.

  • Step 3: Write the Script

  • Step 4: Make the Script Executable

    Make the script executable by changing its permissions. Run the following command in the terminal:

  • Step 5: Run the Script

    Now you can run the script with the required arguments. Here are the examples you provided:

Read About User Management:

  • A user is an entity in a Linux operating system that can manipulate files and perform several other operations. Each user is assigned an ID that is unique within the system. IDs 0 to 999 are assigned to system users, and local user IDs start from 1000 onwards.

  • Create 2 users and display their usernames.

Read About Cron and Crontab to Automate the Backup Script:

  • Cron is the system's main scheduler for running jobs or tasks unattended. A command called crontab allows the user to submit, edit, or delete entries to cron. A crontab file is a user file that holds the scheduling information.

Summery :

This is all about task 5 of 90 days of devops where we learn about shell some cammand crontaband user Mangement.

ย