Giter VIP home page Giter VIP logo

backup_setup's Introduction

Backup Script README

Overview

This script is designed to help manage file backups on a Linux system. It provides a menu-based interface to add source directories, specify a destination directory, set a backup schedule, and initiate backups using cron jobs.

Authors

  • Angelo Prebianca
  • JOAO VICTOR MOTA MACHADO
  • Marcos Renato Rocha de Medeiros

Project

Final project for Systems Administration.

Features

  • Add multiple source directories for backup.
  • Specify a single destination directory.
  • Set backup frequency using cron scheduling.
  • Start and schedule backups.
  • Color-coded interface for better readability.

Usage

Run the script in a bash terminal to start the backup manager.

./backup_script.sh

Menu Options

  1. Add Source Directory: Add one or more directories to the list of sources to be backed up.
  2. List and Remove Source Directories: Display the current list of source directories and remove any if needed.
  3. Set Backup Destination: Specify the destination directory where backups will be stored.
  4. Set Backup Frequency: Define the schedule for the backup using cron syntax.
  5. Start and Schedule Backup: Initiate the backup process and set up the cron job.
  6. Exit: Exit the backup script.

Color Codes

  • Blue: General information and prompts.
  • Green: Success messages.
  • Red: Error messages or warnings.
  • White: Default text color.

Functions

Menu

Displays the main menu and handles user input for various options.

adcOrigem

Prompts the user to add a source directory for backup.

rmvOrigem

Lists current source directories and allows the user to remove any.

setDestino

Prompts the user to set or change the backup destination directory.

freqBackup

Prompts the user to set the schedule for backups and validates the input.

getInput

Checks if a cron schedule is already set, prompts the user to set a new schedule if needed.

startBackup

Validates the source and destination directories, creates the backup script, schedules it using cron, and executes the backup.

Example Cron Schedule

To set the backup schedule, provide the following inputs when prompted:

  • Minute: 0-59 or *
  • Hour: 0-23 or *
  • Day of Month: 1-31 or *
  • Month: 1-12 or *
  • Day of Week: 0-6 or *

The script will generate a cron schedule string and inform you of the set schedule.

Notes

  • Ensure the script has execute permissions.
  • The script will create the backup directory if it does not exist, upon user confirmation.
  • Only one backup destination can be set at a time.
  • The script will remove any previous backup cron jobs before scheduling a new one.

License

This project is licensed under the MIT License.

backup_setup's People

Contributors

mr-renatoblue avatar jvmotadev avatar angelopre avatar

Watchers

 avatar

Forkers

mr-renatoblue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.