Day 05 Task:

1.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 -

Example 1: When the script is executed as

./createDirectories.shday 1 90

then it creates 90 directories as day1 day2 day3 .... day90

output

2.Create a Script to backup all your work done till now

backup has been taken successfully and a tgz file is created in the backups directory indicating the backup is being done and captured in target (mybackups)directory.

3.Read about Cron and Crontab, to automate the backup Script

Cron: Cron is a time-based job scheduler in Unix-like operating systems, including Linux. It allows you to schedule tasks or commands to run at specific times, intervals, or dates without manual intervention. These tasks can be anything from running scripts, executing commands, or performing system maintenance.

Cron Tab: Cron tab (short for "crontable") is a file used to configure cron jobs. It's essentially a list of instructions for the cron daemon (the background process that executes scheduled tasks) to follow. Each line in the cron tab represents a cron job, specifying the schedule and the command or script to be executed.

  • let's see how to create/automate cron jobs

  • To automate the backup script for every 2 mins,for every 2 minutes a backup will be taken automatically

  • mypersonaldocs has been backup at 15:58 and 16:00

4.Read about User Management and Let me know on Linkedin if you're ready for Day 6.

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 for each user in the operating system. In this post, we will learn about users and commands which are used to get information about the users. After installation of the operating system, the ID 0 is assigned to the root user and the IDs 1 to 999 (both inclusive) are assigned to the system users and hence the ids for local user begins from 1000 onwards.

5.Create 2 users and just display their Usernames