This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
vps:vps4th2nd_08 [2019/06/29 22:24] hoge@hoge [サーバ証明書の更新] |
vps:vps4th2nd_08 [2019/07/13 18:56] (current) hoge@hoge [アップロード] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== 運用 ====== | ====== 運用 ====== | ||
| ===== 日次バックアップ ===== | ===== 日次バックアップ ===== | ||
| + | ==== rclone ==== | ||
| + | * jailerに rclone をインストールする。 | ||
| + | * [[https://rclone.org/drive/|Google Drive]] を参照して rclone.config を作成する。\\ jailer は headless なので、tee で token をテキスト出力する。<code> | ||
| + | # rclone config | tee /usr/jail/desktop/path/to/userdir/rclone.txt | ||
| + | <省略 / 参照先の通り> | ||
| + | Use auto config? | ||
| + | * Say Y ifConfigure this as a team drive? | ||
| + | y) Yes | ||
| + | n) No | ||
| + | y/n> not sure | ||
| + | * Say N if you are working on a remote or headless machine or Y didn't work | ||
| + | y) Yes | ||
| + | n) No | ||
| + | y/n> n | ||
| + | If your browser doesn't open automatically go to the following link: https: | ||
| + | //accounts.google.com/o/oauth2/auth?access_type=offline&client_id= | ||
| + | </code> | ||
| + | * rclonne.txt にあるリンク先にアクセスする。 | ||
| + | * 認証後、出力されたコードを入力する。<code> | ||
| + | Enter verification code> xxxxx | ||
| + | Configure this as a team drive? | ||
| + | y) Yes | ||
| + | n) No | ||
| + | y/n>n | ||
| + | <省略 / 参照先の通り> | ||
| + | </code> | ||
| + | * /root/.config/rclone/rclone.conf が作成される。 | ||
| + | |||
| ==== バックアップ ==== | ==== バックアップ ==== | ||
| * jailerにてバックアップスクリプトを作成する。 | * jailerにてバックアップスクリプトを作成する。 | ||
| * バックアップスクリプトを /etc/periodic/dailyに配置する。 | * バックアップスクリプトを /etc/periodic/dailyに配置する。 | ||
| + | * /etc/periodic.conf にバックアップスクリプトを追記する。<code> | ||
| + | #!/bin/sh | ||
| - | ==== アップロード ==== | + | # 900.vpsbkup |
| - | バックアップで作成したファイルを Googleドライブへアップロードする。\\ griveを使用するので正確には同期となる。 | + | daily_vpsbkup_enable="YES" |
| - | * jailerに grive2をインストールする。 | + | # |
| - | * 初回起動<code> | + | |
| - | #cd <Google ドライブと同期したいディレクトリの一つ上> | + | |
| - | #grive -a -s <Google ドライブと同期したいディレクトリ> | tee <出力先ファイル> | + | |
| </code> | </code> | ||
| - | * 出力先ファイルに記載された URLへアクセスし、認証コードを取得する。 | + | |
| - | * 認証コードを入力すると、同期が開始される。<code> | + | ==== アップロード ==== |
| - | Please input the authentication code here: <認証コードを入力> | + | * バックアップディレクトリを Googleドライブと同期する。<code> |
| - | Reading local directories | + | バックアップスクリプトにて |
| - | Reading remote server file list | + | rclone --config="/root/.config/rclone/rclone.conf" sync <ローカルパス> remote:<Google ドライブのディレクトリ> |
| - | Synchronizing files | + | |
| - | sync "./<Google 同ライブと同期したいディレクトリ>" created in remote. creating local | + | |
| - | Finished! | + | |
| </code> | </code> | ||
| - | * griveはdaemonではないので、都度実行する必要がある。実行はバックアップスクリプト内で行う。 | ||
| ===== Let's Encrypt 管理 ===== | ===== Let's Encrypt 管理 ===== | ||