Day 5 : 90 Days of DevOps Advanced Linux Shell Scripting with User management
Write a bash script createDirectories.sh that when the script is executed with three given arguments (one is directory name and second is start number of directories and third is the end number of directories ) it creates specified number of directories with a dynamic directory name.
Create a Script to back up all your work done till now.
Read About Cron and Crontab, to automate the Script
Cron is a Linux utility that schedules tasks to run automatically at specified intervals. The tasks are defined in a crontab file, which is a simple text file containing a list of commands meant to be run at specified times. Each line of the file represents a single cron job and follows a particular syntax.
A crontab file is composed of six fields, separated by spaces, that specify the schedule for a task to run. The fields, in order, are:
* Minute (0–59)
* Hour (0–23)
* Day of the month (1–31)
* Month (1–12)
* Day of the week (0–7, where both 0 and 7 represent Sunday) Command to be executed You can use the command crontab -e to edit your crontab file and crontab -l to list the current crontab file.
You can also use crontab -r to remove your current crontab file, crontab -d to delete a specific user crontab and cron -l -u to list a specific user crontab.
Read about User Management
User management refers to the process of creating, modifying, and deleting user accounts on a computer system or network. It also includes managing user permissions and access to resources.
Some common tasks related to user management are:
Creating new user accounts with a unique username and password Assigning different levels of privileges or permissions to users, such as access to certain files or directories Changing or resetting user passwords Disabling or deleting user accounts Managing groups of users and assigning group permissions Auditing user activity and tracking changes to user accounts On Linux systems, user management can be done using the command line tools such as useradd, usermod, userdel, passwd, and groupadd, groupmod, groupdel.
Create 2 users and just display their Usernames
Subscribe to my newsletter
Read articles from Rishi Gupta directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by