Skip to content

hima890/bashScriptingProjects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backup Script Project

This Bash script automates the backup of a specified directory, allowing you to run it at scheduled intervals. The script checks if 24 hours have passed since the last backup and, if so, initiates a new backup.

Table of Contents


Features

  • Automated Backup: The script automatically backs up a specified directory.
  • Scheduled Backups: You can schedule the script to run at specific intervals.
  • Log Files: Logs are maintained to keep track of backup activities.

Prerequisites

Before using the script, ensure you have the following prerequisites:

  • Bash (shell scripting environment)
  • Tar command (for creating compressed archives)
  • Cron (for scheduling automated backups)

Installation

  1. Clone the repository or download the script to your local machine.

    git clone https://github.com/hima890/backup-script.git
  2. Make the script executable.

    chmod +x backup_script.sh

Configuration

Edit the config.txt file to set the paths and configurations:

# Specify the path to your project folder
directory_to_compress="/path/to/your/project"

# Specify the path to your backup folder
backup_folder="/path/to/your/backup/folder"

Usage

Run the script manually:

./backup_script.sh

This will prompt you to initiate the backup. Follow the instructions to proceed.


Automated Scheduling

To schedule the script to run automatically, add a cron job:

  1. Open the crontab editor:

    crontab -e
  2. Add a cron job entry to run the script every day at midnight:

    0 0 * * * /path/to/your/backup_script.sh >/dev/null 2>&1 &

    Save and exit the crontab editor.


Logs

Logs are maintained in the backup_log.txt file. This file contains timestamps and messages related to backup activities.


License

This project is licensed under the MIT License.

About

Automate the backup of your important project folders with this Bash script. Schedule backups at your convenience and keep track of activities with timestamped logs. Never worry about losing your crucial data again.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages