Advanced Linux Shell Scripting for DevOps Engineers with User management
Tasks
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 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.
Script
Example 1: When the script is executed as
./createDirectories.sh day 1 90
then it creates 90 directories as day1 day2 day3 .... day90
Example 2: When the script is executed as
./createDirectories.sh Movie 20 50 then it creates 50 directories as Movie20 Movie21 Movie23 ...Movie50
2. Create a Script to backup all your work done till now.
Backups are an important part of DevOps Engineers day to Day activities The video in References will help you to understand How a DevOps Engineer takes backups.
Here is the backup Script
3. What is Cron and Crontab, to automate the backup Script
Cron is a time-based job scheduler in Unix-like operating systems. It is used to schedule commands or scripts to run periodically at a specified time and date.
Crontab (cron table) is a text file that contains the commands to be executed by the cron daemon. It is used to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. The crontab files are stored where the lists of jobs and other instructions to the cron daemon are kept. Users can use the crontab command to edit their own crontab files and schedule jobs (commands) to run automatically.
Using Cron and Crontab, you can automate your backup script so that it runs at regular intervals without any manual intervention. You can set up Cron jobs that will execute your backup script on a daily, weekly, monthly, or yearly basis. This way, you can ensure that your data is always backed up on a regular basis and you don't have to worry about forgetting to do it manually.
4. What is User Management in Linux?
User Management in Linux is the process of managing user accounts and their associated privileges. This includes creating, modifying, deleting, and managing user accounts, setting passwords, assigning permissions and privileges to users, and monitoring user activity. It also involves managing groups of users and setting up authentication methods such as SSH keys or password authentication.
4K+LinkedIn Family | Docker Captain 🐳 | CSE | Vcluster | loft labs | Technical Content Writer |Tech Speaker | Open Source Contributor| Cloud Native enthusiast
2yGood write up that is ✨