# #Day05 of 90DayOfDevOps

### **Task 1**:

**Create Directories Using Shell Script:**

* Write a bash script [`createDirectories.sh`](http://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.sh`](http://createDirectories.sh) `day 1 90`, it creates 90 directories as `day1 day2 day3 ... day90`.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728449578024/24cdac7a-af6a-4e2f-a4ac-a4b566544dfc.png align="center")

### **Task 2**:

**Create a Script to Backup All Your Work:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728455392309/90f22177-dc88-4fa2-b718-c929abda46d9.png align="center")

Save this script in a file, e.g., [backup.sh](http://backup.sh), and make it executable using chmod +x [backup.sh](http://backup.sh).

To automate this backup script using Cron, you can add an entry to your user's crontab by running crontab -e and adding a line like this to run the script daily at a specific time:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728455451112/b0244037-2177-4f77-b0d5-23dcad58c95e.png align="center")

### **Task 3:**

**Read About Cron and Crontab to Automate the Backup Script:**

**Cron** is a Unix-based utility used to schedule scripts or commands to run automatically at specified intervals. It is commonly used to automate tasks like backups, system updates, or periodic reports. **Crontab** (Cron Table) is a configuration file where you specify the schedule for your jobs. Each user can have their own crontab, and the system can run various scheduled tasks for different users.

### **Key Concepts in Cron:**

* **Cron Daemon**: A background service that runs the scheduled jobs.
    
* **Crontab File**: A file where cron jobs are defined. You edit it to set up your automated tasks.
    
* **Cron Job**: A task or script that gets executed at a specified schedule.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728455921506/8319a6f9-79dd-4522-b41e-83540c4b0892.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728455947974/826f4f5f-0579-4cf7-b606-cccace95c9da.png align="center")

### **Using Cron for Backup Automation**

Now, with the backup script in place and crontab set up, your work documents will be automatically backed up based on the schedule you specify. You can customize the backup interval (e.g., daily, weekly) by adjusting the crontab entry accordingly.

### **Task 4** :

**Read About User Management:**

User management is an essential aspect of Linux systems, where each user has a unique identity and a set of permissions. Admins use user management to control access, assign roles, and protect the system from unauthorized access. Users can be created, deleted, and managed using various commands.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728456252056/d911375a-e446-4c4b-bb06-412ccbb653ec.png align="center")

I'm confident that this article will prove to be valuable, helping you discover new insights and learn something enriching .

thank you : )
