Coder Social home page Coder Social logo

drivebackup's Introduction

DriveBackup

Basic backup shell script with logging & config file that uses GDrive CLI
Supports Discord Notifications for convenience.

Configuration

The Discord Webhook and User ID can be defined at the top of the shell script.

For the configuration file, separate the entries by using : inbetween.

Part Example
File/Folder Name my_target_file_or_folder
Amount of old versions to keep 5
File/Folder Path "/absolute/path/to/file/or/folder.tar"
Target Directory ID 123GDRIVE456ID789
Excluded files/folders (optional) "/exclude/this/sub/dir/or/folder"

Excluding files and folders is optional and can be concatenated using , like so:
"/excluded/folder/,/exclude_partially/exclude_me.doc"

Usage

  • Place the backup.sh script in a folder of your choice
  • Make it executable using chmod +x backup.sh
  • Create a *.conf file with your to be secured file & folders along with their destination folder IDs (GDrive)
  • Execute the shell script using the *.conf file as parameter

Sample start command:

./backup.sh backup.conf

This will generate a log file of the same name of your *.conf file e.g. "backup.log".

Automation

Open crontab using crontab -e
Then add a new entry with your preferred time schedule 0 0 * * * /path/to/backup.sh backup.conf
Tip: Use crontab.guru to generate your cron schedule expression.

drivebackup's People

Contributors

run2go avatar

Stargazers

 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.