Coder Social home page Coder Social logo

ggg6r34t / automated-backup-script Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4 KB

An automated backup script that simplifies data backup, offers encryption, compression, and remote backup, and seamlessly integrates with cloud storage services, providing unprecedented ease and efficiency.

Shell 100.00%

automated-backup-script's Introduction

Automated Backup Script

The Automated Backup Script is a Bash script that automates the backup process for specified files or directories. This script is designed to simplify the backup process and provide basic logging functionality.

Usage

Running the Script

  1. Make the script executable: chmod +x backup.sh
  2. To perform a backup, run: ./backup.sh /path/to/source /path/to/backup

Setting Up Cron Jobs

To automate backups at regular intervals, you can set up a cron job:

  1. Open crontab: crontab -e
  2. Schedule the script, e.g.: 0 2 * * * /path/to/backup.sh /path/to/source /path/to/backup

Make sure to adjust the paths and timing to match your preferences.

Configuration

Edit backup.sh to set source and backup directories:

source_dir="/path/to/source"
backup_dir="/path/to/backup"

Examples

Command-Line Usage

To run the backup script from the command line:

./backup.sh /home/user/documents /mnt/backup_drive

Logging

The script includes basic logging functionality. Log messages are stored in the backup.log file within the backup directory.

Sample Log File

2023-08-28 14:30:00 - Backup completed: /home/user/documents โ†’ /mnt/backup_drive/backup_2023-08-28_14-30-00
2023-08-28 14:45:00 - Removed old backup: /mnt/external_drive/backups/backup_2023-08-25_14-30-00

Log entries provide information about backup activities and the removal of old backups.


automated-backup-script's People

Contributors

ggg6r34t avatar

Watchers

 avatar

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.