diff --git a/2024/day03/image/task 1.png b/2024/day03/image/task 1.png deleted file mode 100644 index 6d43acbea..000000000 Binary files a/2024/day03/image/task 1.png and /dev/null differ diff --git a/2024/day03/image/task 10.png b/2024/day03/image/task 10.png deleted file mode 100644 index bd1ad3ce0..000000000 Binary files a/2024/day03/image/task 10.png and /dev/null differ diff --git a/2024/day03/image/task 11.png b/2024/day03/image/task 11.png deleted file mode 100644 index 92f1a020b..000000000 Binary files a/2024/day03/image/task 11.png and /dev/null differ diff --git a/2024/day03/image/task 12.png b/2024/day03/image/task 12.png deleted file mode 100644 index 40cf2f5d6..000000000 Binary files a/2024/day03/image/task 12.png and /dev/null differ diff --git a/2024/day03/image/task 2.png b/2024/day03/image/task 2.png deleted file mode 100644 index 321719e41..000000000 Binary files a/2024/day03/image/task 2.png and /dev/null differ diff --git a/2024/day03/image/task 3.png b/2024/day03/image/task 3.png deleted file mode 100644 index 826454870..000000000 Binary files a/2024/day03/image/task 3.png and /dev/null differ diff --git a/2024/day03/image/task 4.png b/2024/day03/image/task 4.png deleted file mode 100644 index f5f90b8a5..000000000 Binary files a/2024/day03/image/task 4.png and /dev/null differ diff --git a/2024/day03/image/task 5.png b/2024/day03/image/task 5.png deleted file mode 100644 index 68966372f..000000000 Binary files a/2024/day03/image/task 5.png and /dev/null differ diff --git a/2024/day03/image/task 6.png b/2024/day03/image/task 6.png deleted file mode 100644 index 2ddfdbab2..000000000 Binary files a/2024/day03/image/task 6.png and /dev/null differ diff --git a/2024/day03/image/task 66.png b/2024/day03/image/task 66.png deleted file mode 100644 index 5360649b4..000000000 Binary files a/2024/day03/image/task 66.png and /dev/null differ diff --git a/2024/day03/image/task 7.png b/2024/day03/image/task 7.png deleted file mode 100644 index e16aa3937..000000000 Binary files a/2024/day03/image/task 7.png and /dev/null differ diff --git a/2024/day03/image/task 8.png b/2024/day03/image/task 8.png deleted file mode 100644 index 48cd782df..000000000 Binary files a/2024/day03/image/task 8.png and /dev/null differ diff --git a/2024/day03/image/task 9.png b/2024/day03/image/task 9.png deleted file mode 100644 index 8013d510c..000000000 Binary files a/2024/day03/image/task 9.png and /dev/null differ diff --git a/2024/day03/image/task1.png b/2024/day03/image/task1.png new file mode 100644 index 000000000..8fa12517b Binary files /dev/null and b/2024/day03/image/task1.png differ diff --git a/2024/day03/image/task10.png b/2024/day03/image/task10.png new file mode 100644 index 000000000..384bc7920 Binary files /dev/null and b/2024/day03/image/task10.png differ diff --git a/2024/day03/image/task11.png b/2024/day03/image/task11.png new file mode 100644 index 000000000..8aaa148f1 Binary files /dev/null and b/2024/day03/image/task11.png differ diff --git a/2024/day03/image/task12.png b/2024/day03/image/task12.png new file mode 100644 index 000000000..f1789f361 Binary files /dev/null and b/2024/day03/image/task12.png differ diff --git a/2024/day03/image/task2.png b/2024/day03/image/task2.png new file mode 100644 index 000000000..e59a5c2db Binary files /dev/null and b/2024/day03/image/task2.png differ diff --git a/2024/day03/image/task3.png b/2024/day03/image/task3.png new file mode 100644 index 000000000..1979c0534 Binary files /dev/null and b/2024/day03/image/task3.png differ diff --git a/2024/day03/image/task4.png b/2024/day03/image/task4.png new file mode 100644 index 000000000..e15d31083 Binary files /dev/null and b/2024/day03/image/task4.png differ diff --git a/2024/day03/image/task5.png b/2024/day03/image/task5.png new file mode 100644 index 000000000..e171fb76d Binary files /dev/null and b/2024/day03/image/task5.png differ diff --git a/2024/day03/image/task6.png b/2024/day03/image/task6.png new file mode 100644 index 000000000..48f2ab217 Binary files /dev/null and b/2024/day03/image/task6.png differ diff --git a/2024/day03/image/task7.1.png b/2024/day03/image/task7.1.png new file mode 100644 index 000000000..c6ff40fd5 Binary files /dev/null and b/2024/day03/image/task7.1.png differ diff --git a/2024/day03/image/task7.2.png b/2024/day03/image/task7.2.png new file mode 100644 index 000000000..3c37bbc70 Binary files /dev/null and b/2024/day03/image/task7.2.png differ diff --git a/2024/day03/image/task8.1.png b/2024/day03/image/task8.1.png new file mode 100644 index 000000000..c87148c10 Binary files /dev/null and b/2024/day03/image/task8.1.png differ diff --git a/2024/day03/image/task8.2.png b/2024/day03/image/task8.2.png new file mode 100644 index 000000000..5782ea714 Binary files /dev/null and b/2024/day03/image/task8.2.png differ diff --git a/2024/day03/image/task9.png b/2024/day03/image/task9.png new file mode 100644 index 000000000..b36b9e59c Binary files /dev/null and b/2024/day03/image/task9.png differ diff --git a/2024/day03/solution.md b/2024/day03/solution.md index 3f094c964..12e8e288f 100644 --- a/2024/day03/solution.md +++ b/2024/day03/solution.md @@ -3,49 +3,59 @@ Task 1: View the content of a file and display line numbers. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%201.png) +![task1](image/task1.png) Task 2: Change the access permissions of files to make them readable, writable, and executable by the owner only. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%202.png) +![task2](image/task2.png) Task 3: Check the last 10 commands you have run. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%203.png) +![task3](image/task3.png) Task 4: Remove a directory and all its contents. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%204.png) +![task4](image/task4.png) Task 5: Create a `fruits.txt` file, add content (one fruit per line), and display the content. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%205.png) +![task5](image/task5.png) Task 6: Add content in `devops.txt` (one in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava. Then, append "Pineapple" to the end of the file. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%206.png) -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%2066.png) +![task6](image/task6.png) Task 7: Show the first three fruits from the file in reverse order. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%207.png) +Two ways to do : + +1. ![task7.1](image/task7.1.png) + +2. ![task7.2](image/task7.2.png) + Task 8: Show the bottom three fruits from the file, and then sort them alphabetically. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%208.png) +Two ways to do : + +1. ![task8.1](image/task8.1.png) + +2. ![task8.2](image/task8.2.png) + Task 9: Create another file `Colors.txt`, add content (one color per line), and display the content. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%209.png) +![task9](image/task9.png) Task 10: Add content in `Colors.txt` (one in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey. Then, prepend "Yellow" to the beginning of the file. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%2010.png) +![task10](image/task10.png) Task 11: Find and display the lines that are common between `fruits.txt` and `Colors.txt`. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%2011.png) +![task11](image/task11.png) Task 12: Count the number of lines, words, and characters in both `fruits.txt` and `Colors.txt`. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day03/image/task%2012.png) +![task12](image/task12.png) + diff --git a/2024/day04/image/task 1.png b/2024/day04/image/task 1.png deleted file mode 100644 index ffc9913f6..000000000 Binary files a/2024/day04/image/task 1.png and /dev/null differ diff --git a/2024/day04/image/task 11.png b/2024/day04/image/task 11.png deleted file mode 100644 index d4402482e..000000000 Binary files a/2024/day04/image/task 11.png and /dev/null differ diff --git a/2024/day04/image/task 2.png b/2024/day04/image/task 2.png deleted file mode 100644 index 4f7a735bc..000000000 Binary files a/2024/day04/image/task 2.png and /dev/null differ diff --git a/2024/day04/image/task 3.png b/2024/day04/image/task 3.png deleted file mode 100644 index 5baeb479a..000000000 Binary files a/2024/day04/image/task 3.png and /dev/null differ diff --git a/2024/day04/image/task 4.png b/2024/day04/image/task 4.png deleted file mode 100644 index ea366a253..000000000 Binary files a/2024/day04/image/task 4.png and /dev/null differ diff --git a/2024/day04/image/task 5.png b/2024/day04/image/task 5.png deleted file mode 100644 index 9ab2dc3ee..000000000 Binary files a/2024/day04/image/task 5.png and /dev/null differ diff --git a/2024/day04/image/task3.1.png b/2024/day04/image/task3.1.png new file mode 100644 index 000000000..7bd3a0ab8 Binary files /dev/null and b/2024/day04/image/task3.1.png differ diff --git a/2024/day04/image/task3.2.png b/2024/day04/image/task3.2.png new file mode 100644 index 000000000..b0faace31 Binary files /dev/null and b/2024/day04/image/task3.2.png differ diff --git a/2024/day04/image/task4.1.png b/2024/day04/image/task4.1.png new file mode 100644 index 000000000..07846cc36 Binary files /dev/null and b/2024/day04/image/task4.1.png differ diff --git a/2024/day04/image/task4.2.png b/2024/day04/image/task4.2.png new file mode 100644 index 000000000..001acb18f Binary files /dev/null and b/2024/day04/image/task4.2.png differ diff --git a/2024/day04/image/task5.1.png b/2024/day04/image/task5.1.png new file mode 100644 index 000000000..9e9a6470b Binary files /dev/null and b/2024/day04/image/task5.1.png differ diff --git a/2024/day04/image/task5.2.png b/2024/day04/image/task5.2.png new file mode 100644 index 000000000..84af8db46 Binary files /dev/null and b/2024/day04/image/task5.2.png differ diff --git a/2024/day04/solution.md b/2024/day04/solution.md index b9020734e..101bda96d 100644 --- a/2024/day04/solution.md +++ b/2024/day04/solution.md @@ -4,25 +4,25 @@ Task 1: Explain in your own words and with examples what Shell Scripting means for DevOps. - 'Shell Scripting is writing a series of commands in a script file to automate tasks in the Unix/Linux shell. For DevOps, shell scripting is crucial for automating repetitive tasks, managing system configurations, deploying applications, and integrating various tools and processes in a CI/CD pipeline. It enhances efficiency, reduces errors, and saves time.' -Example: Automating server setup -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day04/image/task%201.png) -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day04/image/task%2011.png) - Task 2: What is `#!/bin/bash`? Can we write `#!/bin/sh` as well? - `#!/bin/bash` is called a "shebang" line. It indicates that the script should be run using the Bash shell. - `#!/bin/bash`: Uses Bash as the interpreter. It supports advanced features like arrays, associative arrays, and functions. - `#!/bin/sh`: Uses the Bourne shell. It’s more POSIX-compliant and is generally compatible with different Unix shells. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day04/image/task%202.png) - Task 3: Write a Shell Script that prints `I will complete #90DaysOfDevOps challenge`. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day04/image/task%203.png) +![task3.1](image/task3.1.png) + +![task3.2](image/task3.2.png) Task 4: Write a Shell Script that takes user input, input from arguments, and prints the variables. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day04/image/task%204.png) +![task4.1](image/task4.1.png) + +![task4.2](image/task4.2.png) Task 5: Provide an example of an If-Else statement in Shell Scripting by comparing two numbers. -![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day04/image/task%205.png) +![task5.1](image/task5.1.png) + +![task5.2](image/task5.2.png) diff --git a/2024/day05/image/task 1-2.png b/2024/day05/image/task 1-2.png deleted file mode 100644 index 66d467cf1..000000000 Binary files a/2024/day05/image/task 1-2.png and /dev/null differ diff --git a/2024/day05/image/task 1-3.png b/2024/day05/image/task 1-3.png deleted file mode 100644 index d5b269904..000000000 Binary files a/2024/day05/image/task 1-3.png and /dev/null differ diff --git a/2024/day05/image/task 1.png b/2024/day05/image/task 1.png deleted file mode 100644 index 1ac28abb7..000000000 Binary files a/2024/day05/image/task 1.png and /dev/null differ diff --git a/2024/day05/image/task 2-1.png b/2024/day05/image/task 2-1.png deleted file mode 100644 index f62a8a053..000000000 Binary files a/2024/day05/image/task 2-1.png and /dev/null differ diff --git a/2024/day05/image/task 2.png b/2024/day05/image/task 2.png deleted file mode 100644 index 32fa6a6a3..000000000 Binary files a/2024/day05/image/task 2.png and /dev/null differ diff --git a/2024/day05/image/task 3-1.png b/2024/day05/image/task 3-1.png deleted file mode 100644 index 14086027a..000000000 Binary files a/2024/day05/image/task 3-1.png and /dev/null differ diff --git a/2024/day05/image/task 3.png b/2024/day05/image/task 3.png deleted file mode 100644 index 0c6bf33d1..000000000 Binary files a/2024/day05/image/task 3.png and /dev/null differ diff --git a/2024/day05/image/task 4.png b/2024/day05/image/task 4.png deleted file mode 100644 index 8145a7ab0..000000000 Binary files a/2024/day05/image/task 4.png and /dev/null differ diff --git a/2024/day05/image/task1.1.png b/2024/day05/image/task1.1.png new file mode 100644 index 000000000..3c73880ea Binary files /dev/null and b/2024/day05/image/task1.1.png differ diff --git a/2024/day05/image/task1.2.png b/2024/day05/image/task1.2.png new file mode 100644 index 000000000..88f6d0703 Binary files /dev/null and b/2024/day05/image/task1.2.png differ diff --git a/2024/day05/image/task2.1.png b/2024/day05/image/task2.1.png new file mode 100644 index 000000000..efafe683a Binary files /dev/null and b/2024/day05/image/task2.1.png differ diff --git a/2024/day05/image/task2.2.png b/2024/day05/image/task2.2.png new file mode 100644 index 000000000..5e5652270 Binary files /dev/null and b/2024/day05/image/task2.2.png differ diff --git a/2024/day05/image/task2.3.png b/2024/day05/image/task2.3.png new file mode 100644 index 000000000..e4416cc7b Binary files /dev/null and b/2024/day05/image/task2.3.png differ diff --git a/2024/day05/image/task3.1.png b/2024/day05/image/task3.1.png new file mode 100644 index 000000000..c8cacca92 Binary files /dev/null and b/2024/day05/image/task3.1.png differ diff --git a/2024/day05/image/task3.2.png b/2024/day05/image/task3.2.png new file mode 100644 index 000000000..76343f201 Binary files /dev/null and b/2024/day05/image/task3.2.png differ diff --git a/2024/day05/image/task3.3.png b/2024/day05/image/task3.3.png new file mode 100644 index 000000000..3751370e9 Binary files /dev/null and b/2024/day05/image/task3.3.png differ diff --git a/2024/day05/image/task3.4.png b/2024/day05/image/task3.4.png new file mode 100644 index 000000000..c92ad6189 Binary files /dev/null and b/2024/day05/image/task3.4.png differ diff --git a/2024/day05/image/task3.5.png b/2024/day05/image/task3.5.png new file mode 100644 index 000000000..14810853c Binary files /dev/null and b/2024/day05/image/task3.5.png differ diff --git a/2024/day05/image/task3.6.png b/2024/day05/image/task3.6.png new file mode 100644 index 000000000..36a93be83 Binary files /dev/null and b/2024/day05/image/task3.6.png differ diff --git a/2024/day05/image/task4.1.png b/2024/day05/image/task4.1.png new file mode 100644 index 000000000..a6b9438b9 Binary files /dev/null and b/2024/day05/image/task4.1.png differ diff --git a/2024/day05/image/task4.2.png b/2024/day05/image/task4.2.png new file mode 100644 index 000000000..fb97ba117 Binary files /dev/null and b/2024/day05/image/task4.2.png differ diff --git a/2024/day05/solution.md b/2024/day05/solution.md index aea602995..cb4d267f4 100644 --- a/2024/day05/solution.md +++ b/2024/day05/solution.md @@ -10,25 +10,122 @@ **Answer** - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day05/image/task%201.png) - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day05/image/task%201-2.png) - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day05/image/task%201-3.png) + - Creating createDirectories.sh and adding below content : + + ``` bash + + #!/bin/bash + + < permission_backup.txt + + # Check if the command was successful + if [[ $? -eq 0 ]]; then + echo "Permissions backed up successfully to permission_backup.txt" + else + echo "Failed to backup permissions." + fi + ``` + + + - Task: Create another script that restores the permissions from the backup file. **Answer** - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day06/image/task6-1.png) + ![task6.2](image/task6.2.png) + + + restore_backup.sh : + + ```bash + #!/bin/bash + + < /etc/apt/sources.list.d/jenkins.list' - - Update the package list: - ```bash - sudo apt update - - Install Jenkins: - ```bash - sudo apt install jenkins - - Start Jenkins: - ```bash - sudo systemctl start jenkins - - Note: - - First, check whether JAVA is installed or not. - ```bash - java -version - - If you have not installed - ```bash - sudo apt install default-jre - - Output - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day07/image/task1.png) - - Output (Jenkins-UI) - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day07/image/task1-2.png) + - Docker installation proof : + + ![task1.1](image/task1.1.png) + + ![task1.2](image/task1.2.png) + + - Jenkins installation proof : + + ![task1.3](image/task1.3.png) + + ![task1.4](image/task1.4.png) 2. **Write a Blog or Article:** - Write a small blog or article on how to install these tools using package managers on Ubuntu and CentOS. - **Answer** - 1. Introduction: - - Briefly introduce Docker and Jenkins. - - Mention the operating systems (Ubuntu and CentOS) covered. - 2. Installing Docker on Ubuntu: - - List the steps as detailed above. - 3. Installing Docker on CentOS: - - Provide similar steps adjusted for CentOS. - 4. Installing Jenkins on Ubuntu: - - List the steps as detailed above. - 5. Installing Jenkins on CentOS: - - Provide similar steps adjusted for CentOS. + - Checkout blog here : https://amitabhdevops.hashnode.dev/docker-and-jenkins-installation ### Systemctl and Systemd Systemctl is used to examine and control the state of the “systemd” system and service manager. Systemd is a system and service manager for Unix-like operating systems (most distributions, but not all). + ## Tasks 1. **Check Docker Service Status:** - Check the status of the Docker service on your system (ensure you have completed the installation tasks above). **Answer** - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day07/image/task5.png) + + ![task2.1](image/task2.1.png) 2. **Manage Jenkins Service:** - Stop the Jenkins service and post before and after screenshots. - **Answer** - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day07/image/taskj2.png) + - Before stopping : + + ![task3.1](image/task1.3.png) + + + - After stopping : + + ![task3.2](image/task3.2.png) + 3. **Read About Systemctl vs. Service:** - Read about the differences between the `systemctl` and `service` commands. - Example: `systemctl status docker` vs. `service docker status`. **Answer** - - Understanding the `systemctl` and `service` Commands - - Both `systemctl` and `service` commands are used to manage system services in Linux, but they differ in terms of usage, functionality, and the system architectures they support. - - **`systemctl` Command** - - `systemctl` is a command used to introspect and control the state of the `systemd` system and service manager. It is more modern and is used in systems that use `systemd` as their init system, which is common in many contemporary Linux distributions. - - Examples: - - Check the status of the Docker service: - ```bash - sudo systemctl status docker - - Start the Jenkins service: - ```bash - sudo systemctl start jenkins - - Stop the Docker service: - ```bash - sudo systemctl stop docker - - Enable the Jenkins service to start at boot: - ```bash - sudo systemctl enable jenkins - - - **`service` Command** - - 'service' is a command that works with the older 'init' systems (like SysVinit). It provides a way to start, stop, and check the status of services. While it is still available on systems using 'systemd' for backward compatibility, its usage is generally discouraged in favor of 'systemctl'. - - Examples: - - Check the status of the Docker service: - ```bash - sudo service docker status - - Start the Jenkins service: - ```bash - sudo service jenkins start - - Stop the Docker service: - ```bash - sudo service docker stop - - - **Key Differences** - - 1 System Architecture: - - `systemctl` works with `systemd`. - - `service` works with SysVinit and is compatible with `systemd` for backward compatibility. - - 2 Functionality: - - `systemctl` offers more functionality and control over services, including management of the service's state (start, stop, restart, reload), enabling/disabling services at boot, and querying detailed service status. - - `service` provides basic functionality for managing services, such as starting, stopping, and checking the status of services. - - 3 Syntax and Usage: - - `systemctl` uses a more unified syntax for managing services. - - `service` has a simpler and more traditional syntax. + + - For detail understanding of Systemctl and Service read this blog : https://amitabhdevops.hashnode.dev/understanding-the-differences-between-systemctl-and-service-commands-in-linux + + ### Additional Tasks 4. **Automate Service Management:** - Write a script to automate the starting and stopping of Docker and Jenkins services. - **Answer** - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day07/image/task4.png) + - Stopped both Docker and Jenkins : + + ![task4.1](image/task4.1.png) + + - stop_services.sh : + + ```bash + #!/bin/bash + + < The script will create a timestamped backup folder inside the specified directory and copy all the files into it. It will also check for existing backup folders and remove the oldest backups to keep only the last 3 backups. +```bash +ls -t | tail -n +4 +``` - **Answer** +This will list backups older than the latest three backups. - **Create a Folder And Make Some File** +--- - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day09/image/task11.png) +## Steps to Complete the Assignment - - Note: - - First, check whether zip is installed or not. - ```bash - zip - - If you have not installed - ```bash - sudo apt install zip +### 1\. Navigate to the Day-09 Directory - **Crontab Job Scheduling:** - - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day09/image/task2.png) - - Auto scheduling through `crontab job scheduling`: - ```bash - * 1 * * * bash /root/backup.sh /root/datafile /root/backup +Ensure all your scripts are in the `Day-09` directory where you will create the backup script. - **It will take a backup every hour, and the oldest backups will be deleted, leaving only the latest three backups visible:** - - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day09/image/task3.png) +### 2\. Create a New Script File - **Bash Script:** - - ![image](https://github.com/Bhavin213/90DaysOfDevOps/blob/master/2024/day09/image/bash1.png) +In the `Day-09` directory, create a new script file called `backup_with_`[`rotation.sh`](http://rotation.sh) using the following command: - **Reference** - [TrainWithShubham - Production Backup Rotation | Shell Scripting For DevOps Engineer](https://youtu.be/PZYJ33bMXAw?si=Zb50P67x_F32ikeO) +```bash +vim backup_with_rotation.sh +``` - [LinkedIn](https://www.linkedin.com/in/bhavin-savaliya/) +### 3\. Add the Backup Script Content + +Below is the content of the `backup_with_`[`rotation.sh`](http://rotation.sh) script, which will handle both the backup creation and backup rotation: + +#### `backup_with_`[`rotation.sh`](http://rotation.sh): + +```bash +#!/bin/bash + +<