GithubHelp home page GithubHelp logo

marc0janssen / macos-restic-backup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cbergoon/macos-restic-backup

0.0 1.0 0.0 4 KB

Bash scripts to automatically run Restic backups

License: MIT License

Shell 100.00%

macos-restic-backup's Introduction

macOS Restic Backup

Bash scripts to automatically run Restic backups when the repository is available.

The script ensures that the specified Restic Repository is available and then initiates a backup process which backs up each directory listed in the configuration file .restic_backup.conf. The script runs as a launchd job every 4 minutes.

Set Up

To install, first create and initialize two restic repositories; one for local backups and another for remote backups. Local backups will provide a higher resolution history of changes while the remote backups will act as a long-term backup. It is important that the password for both repositories is the same, as they will share the use of an environment variable.

restic init --repo /path/to/localrepo
restic init --repo /path/to/remoterepo

Note that this is not the most secure way to store a password, it does however help contain the application and keep things simple.

A modification should be made to com.cbergoon.restic_cleanup_remote.plist, com.cbergoon.restic_cleanup_remote.plist, com.cbergoon.restic_backup_local.plist and, com.cbergoon.restic_backup_remote.plist to point the scripts to proper Restic repository and specify the password to use.

// com.cbergoon.restic_backup_local.plist
...
<key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/restic_backup.sh</string>
        <string>"/path/to/localrepo"</string>
        <string>testpass</string>
    </array>
...
// com.cbergoon.restic_backup_remote.plist
...
<key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/restic_backup.sh</string>
        <string>"/path/to/remoterepo"</string>
        <string>testpass</string>
    </array>
...

Lastly, run the install.sh script which will create the LaunchDaemons.

./install.sh

macos-restic-backup's People

Contributors

cbergoon avatar marc0janssen avatar

Watchers

James Cloos 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.