Giter VIP home page Giter VIP logo

seminar_server_backup's Introduction

seminar_server_backup

ゼミ室のサーバのルートディレクトリのバックアップスクリプトの置き場

環境

OS: wsl Ubuntu 20.04 lts

最終的なディレクトリ構成

├── backup.sh
├── excluded_patterns.txt
├── init.sh
├── rsync-time-backup
└── store

2 directories, 3 files

注意

実行する前に必ず-nあるいは--dry-runをつけてテスト実行して動作確認を行うこと。


初回準備

github から2つのrepoをDL

git clone --recursive https://github.com/llldagolll/seminar_server_backup.git

環境設定ファイルの作成

touch .env

バックアップに関する設定を.envに追記

BACKUPDIR="{バックアップの置き場}"
SRCDIR="{バックアップしたいデータ}"
LEAVEFILE="{leave_file_patterns.txtのある場所}"

BACKUPDIR="/home/{username}/seminar_server_backup/store"
SRCDIR="/"
LEAVEFILE="/home/{username}/seminar_server_backup/leave_file_patterns.txt"

初期化スクリプト実行

./init.sh

使い方

バックアップの実行

sudo ./backup.sh

バックアップができてるか確認

以下のようになればok

image

tree -L 1 {バックアップの置き場}  
store/
├── 2022-05-23-165426
├── backup.marker
└── latest -> 2022-05-23-165426

2 directories, 1 file

ルートディレクトリの復元

sudo ./restore.sh

参考

https://github.com/laurent22/rsync-time-backup/blob/master/README.md

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.