0% found this document useful (0 votes)
10 views

OSY Report

Uploaded by

Anjali Durgam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

OSY Report

Uploaded by

Anjali Durgam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Maharashtra Board of Technical Education, Mumbai.

Government Polytechnic, Solapur.

DIPLOMA IN COMPUTER TECHNOLOGY


Academic Year 2023-24

Operating Systems

A
MICRO-PROJECT REPORT
ON

'Backup Manager Using Shell Scripting'

Submitted by

Roll.no. Enrollment No. Student Name


37 2100150053 Pratik Santosh Salunke
30 2100150045 Radhekrishna Vyankatesh Kshirsagar

1
MAHARASHTRA STATE BOARD OF

TECHNICAL EDUCATION
(ISO -9001-2008) (ISO/IEC 27001 – 2013)

Certificate

This is to certify that the following students of semester 5th of diploma in


Computer technology of institute, Government Polytechnic Solapur

(INST.Code-0015) have completed the micro project satisfactorily in course of


operating system for the academic year 2023-24 as prescribed in the curriculum.

SUBMITTED BY –

Roll.no. Enrollment No. Student Name


37 2100150053 Pratik Santosh Salunke

GUIDED BY- Prof. Rahul Mundhe

Guide HOD Principal

(Prof Rahul Mundhe) ( Computer Technology) (Government Polytechnic


Solapur)

2
Proposed Methodology
PART-A MICRO PROJECT PROPOSAL

● Aim / benefits of Project:


The primary aim of this microproject is to enhance the Linux Backup
Manager to provide an even more efficient, user-friendly, and reliable
backup solution for Linux users. This enhancement will encompass several
key aspects:
● Proposed Methodology:

1. System Design: We will start by revising the system design


of the Linux Backup Manager. This includes optimizing the
code structure, making it more modular, and ensuring that it
can handle larger datasets efficiently.

2. Initialization: Improving the initialization process to ensure


that the tool is correctly configured and ready for backups,
reducing the likelihood of errors.
3. Resource Allocation: A more robust resource allocation
mechanism will be designed to optimize CPU and memory
usage during backups.

4. Resource Release: Efficient release of system resources


after backup operations to prevent resource leakage.

5. Safety Check: Implement comprehensive safety checks to


verify the integrity of the data both before and after backup
operations.

6. User Interface: Enhance the user interface to provide clearer


feedback on the backup process and make the tool more
intuitive for users.

7. Testing: Rigorous testing will be conducted to ensure that the


enhanced Linux Backup Manager performs reliably under
various conditions and across different Linux distributions.

3
8. Documentation: The documentation will be improved to
include clear, step-by-step instructions on installation,
configuration, and usage. This will enable users, regardless
of their level of expertise, to effectively utilize the tool.

4
Index

Sr. no Title Page


no.
1. Abstract 3
2. Introduction 4
3. Acknowledgement 5
4. Development Process 6
4. Program Code 8
5. Program Output 11
6. Conclusion 13
7. References 14

5
Abstract
The Linux Backup Manager is a shell script-based solution designed to
streamline and automate the backup process for Linux users. This report
explores the development and functionality of this simple yet effective backup
manager.

The Linux Backup Manager is a versatile tool that empowers users to


safeguard their critical data through customizable backup configurations. It
offers the flexibility to select source directories, define backup destinations,
and schedule automatic backups, all while providing feedback on the status of
each backup operation. This tool leverages the power of the Linux
command-line interface and common backup utilities, such as rsync and tar, to
ensure the reliability and efficiency of the backup process.

6
Introduction
In the dynamic landscape of digital information, the need for efficient
data backup and protection has never been more crucial. Linux, with its
open-source philosophy and robust command-line interface, has long been a
platform of choice for users seeking flexibility and control over their computing
environment. In this context, the Linux Backup Manager emerges as a
valuable asset, empowering users to safeguard their data effortlessly.

This report explores the development and functionalities of the Linux


Backup Manager, a shell script-based solution designed to simplify and
automate the backup process for Linux users. In the digital age, where the
volume of data continues to grow exponentially, the Linux Backup Manager
offers a streamlined and customizable approach to backup management. With
its user-friendly features and automation capabilities, this tool not only ensures
the security of critical data but also enhances the overall Linux experience.

The Linux Backup Manager is built on the premise that data protection
should be accessible and user-centric. It recognizes that the Linux user
community consists of diverse individuals, ranging from tech-savvy
enthusiasts to those new to the platform. As such, the manager provides a
balance between simplicity and sophistication, catering to the needs of a
broad audience.

7
Acknowledgement
I would like to express my special thanks to my teacher Prof. Mundhe
sir who gave me the golden opportunity to test this wonderful project “Backup
Manager”. Which also helped me in doing a lot of research and I came to
know about so many new things. I am really thankful to them.
Secondly I would like to thank my parents and friends who helped me a
lot in finalising this project within a limited time frame.
I am doing this project not only for marks but to gain Knowledge. Last
but not least I would like to show gratitude to my classmates for being with me
and helping me in this Project.

8
Development Process
Developing a custom backup manager with shell scripting in Linux involves
several key steps to ensure the script is robust, secure, and meets your
specific backup requirements. Below, we'll outline the development process:

1. Define Backup Requirements


Before diving into the scripting, it's essential to define your backup
requirements. What data do you want to back up? How often should the
backups occur? What is your retention policy? Answering these questions will
help you plan your script effectively.

2. Choose Scripting Tools


In Linux, Bash is the most commonly used shell scripting language. It offers a
wide range of utilities and commands for tasks like file manipulation, data
transfer, and automation. Depending on your needs, you may incorporate
tools like rsync for data synchronization, tar for archiving, or cron for
scheduling.

3. Create the Shell Script


The core of your backup manager is the shell script itself. Here are the key
components to consider when writing the script:

a. User Configuration Variables: Begin by defining variables at the top of the


script that users can customize. These variables may include source
directories, destination directories, retention policy settings, and error
notification options.

b. Backup Logic: Write the backup logic, which typically includes:


Creating a timestamp for the backup folder.
Copying or archiving data from the source directory to the backup destination.
Managing retention by deleting older backups based on the specified retention
policy.
c. Error Handling: Implement error handling mechanisms to capture any
issues during the backup process. You can use if statements and functions to
check for errors, and log them to the error log file specified by the user.

d. Notifications: If desired, add email notifications or other alert mechanisms to


inform the user in case of backup errors.
4. Test the Script

9
Thoroughly test your script in a safe environment before deploying it. Ensure
that it works as expected and handles errors correctly. Run it manually to see
how it behaves and schedule it using cron to simulate automated backups.

5. Document the Script


Create documentation that explains how to configure, use, and troubleshoot
the backup manager script. This documentation is essential for users who
may not be familiar with the script's inner workings.

6. Security Considerations
Pay attention to security aspects. Ensure that the script runs with the
appropriate permissions and that sensitive information, such as passwords or
access credentials, is stored securely.

7. Deployment
Deploy the script on your Linux server or the system where you want to
manage backups. Set up a cron job to schedule regular backups as defined in
your backup requirements.

8. Monitoring and Maintenance


Periodically monitor the script's execution and ensure that backups are
happening as planned. Make adjustments to the retention policy or backup
sources as your data needs change.

9. Backup Testing and Recovery


It's crucial to test the backup and recovery process to ensure that your backup
manager can successfully restore data when needed. Regularly practice
restoring data to guarantee that your backup strategy is reliable.

10
Program Code
#!/bin/bash

# Default destination path


destination="/home/pratik/backup"

# Configuration file to save backup list


config_file="backup_config.txt"

# Initialize the file array with contents from the configuration file
file=()
if [ -f "$config_file" ]; then
while IFS= read -r line; do
file+=("$line")
done < "$config_file"
fi

# Function to save the file list to the configuration file


save_config() {
printf "%s\n" "${file[@]}" > "$config_file"
}

# Function to add a file to the backup list


addfile() {
echo "Enter Your file path [full path should be included along with file
name]"
read filepath
file+=("$filepath")
echo "File added to the backup list: $filepath"
save_config
echo
echo
}

11
# Function to change the backup destination
adddestination() {
echo "Enter new Destination:"
read new_destination
destination="$new_destination"
echo "Destination changed to $destination"
save_config
echo
echo
}

# Function to list the files in the backup list


listfiles() {
echo "Files in Backup list:"
for i in "${file[@]}"; do
echo "$i"
done
echo
echo
}

# Function to perform a backup


performbackup() {
echo "Performing backup..."
# Add your backup logic here, e.g., using tar or rsync
for i in "${file[@]}"; do
backup_file=$(basename "$i")
tar -cvf "$destination/$backup_file.tar" "$i"
done
}

echo
"__________________________________________________________"
echo "WELCOME TO BACKUP MANAGER"
echo
"__________________________________________________________"

while true; do

12
echo "Choose Option:"
echo "1. Add file to backup list"
echo "2. Add Backup destination"
echo "3. List the files in Backup list"
echo "4. Execute Backup Now"
echo "5. Exit"
read choice

case $choice in
1) addfile ;;
2) adddestination ;;
3) listfiles ;;
4) performbackup ;;
5) break ;;
*) echo "Invalid Choice!! Please Try Again!"
esac
done

13
Program Output

14
Conclusion
The Linux Backup Manager represents a significant contribution to the
Linux ecosystem, providing a user-friendly, script-based solution for data
backup and protection. In an age where data is the lifeblood of personal and
professional endeavors, the need for a reliable and customizable backup tool
cannot be understated. This report has delved into the development, features,
and usability of the Linux Backup Manager, demonstrating its value in
simplifying and enhancing the backup process for Linux users.

One of the standout features of the Linux Backup Manager is its


adaptability. Users, regardless of their level of expertise, can easily configure
the tool to suit their unique backup requirements. The ability to select source
directories, specify backup destinations, and schedule automated backups
adds a layer of convenience to data protection, reducing the likelihood of data
loss due to unforeseen circumstances.

The tool's feedback and reporting system make it easy for users to
monitor the status of their backups in real time. This level of transparency
ensures that users can trust in the reliability and success of their backup
operations. Additionally, the ability to customize backup options, such as
compression and encryption, empowers users to tailor their backup strategy to
meet their specific data protection needs.

15
References
● https://manpages.ubuntu.com/manpages/focal/en/man8/backup-manag
er.8.html#:~:text=Backup%20Manager%20is%20an%20easy,%2C%20
mysql%20dumps%2C%20svn%20dump.
● https://ubuntu.com/server/docs/how-to-back-up-using-shell-scripts
● https://iq.opengenus.org/automated-backup-in-linux-using-shell-scriptin
g-and-crontab-scheduler/

16

You might also like