User Tools

Site Tools


vps:vps4th2nd_08

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
vps:vps4th2nd_08 [2019/06/16 20:11]
hoge@hoge created
vps:vps4th2nd_08 [2019/07/13 18:48]
hoge@hoge [アップロード]
Line 4: Line 4:
   * jailerにてバックアップスクリプトを作成する。   * jailerにてバックアップスクリプトを作成する。
   * バックアップスクリプトを /​etc/​periodic/​dailyに配置する。   * バックアップスクリプトを /​etc/​periodic/​dailyに配置する。
 +  * /​etc/​periodic.conf にバックアップスクリプトを追記する。<​code>​
 +#!/bin/sh
 +
 +# 900.vpsbkup
 +daily_vpsbkup_enable="​YES"​
 +
 +</​code>​
  
 ==== アップロード ==== ==== アップロード ====
-バックアップで作成したファイルを Googleドライブへアップロードする。\\ griveを使用するので正確には同期となる。 +バックアップディレクトリを Googleドライブ同期る。 
-  * jailerに ​grive2をインストールする。 +  * jailerに ​rclone ​をインストールする。 
-  * 初回起動<​code>​ +  * [[https://​rclone.org/​drive/​|Google Drive]] を参照して rclone.config を作成する。<​code>​ 
-#cd <Google ドライブと同期したいディレクトリ一つ上+rclone config | tee /​usr/​jail/​desktop/​path/​to/​userdir/​rclone.txt 
-#grive --s <Google ドライブと同期したいディレクトリ| tee <​出力先ファイル>+<省略 / 参照先通り
 +Use auto config? 
 + * Say Y ifConfigure this as team drive? 
 +y) Yes 
 +n) No 
 +y/nnot sure 
 + * Say N if you are working on a remote or headless machine or Y didn't work 
 +y) Yes 
 +n) No 
 +y/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>​ </​code>​
-  ​* 出力先ファイル記載された URLへアクセスし、認証コードを取得する。 +    ​jailer は headless なので、tee で token をテキスト出力する。 
-  * 認証コードを入力すると、同期が開始される。<​code>​ +  * rclonne.txt にあるリンク先にアクセスする。 
-Please input the authentication ​code here: <​認証コードを入力+  * 認証後、出力されたコードを入力する。<​code>​ 
-Reading local directories +Enter verification ​code> ​xxxxx 
-Reading remote server file list +Configure this as a team drive? 
-Synchronizing files +y) Yes 
-sync "./<Google 同ライブと同期したいディレクトリ>" created in remote. creating local +n) No 
-Finished!+y/n>n 
 +<省略 / 参照先の通り>
 </​code>​ </​code>​
-  * griveはdaemonではないので、都度実行する必要る。実行はバックアップスクリプト内で行う。+  * /​root/​.config/​rclone/​rclone.conf ​作成される。 
 +  * バックアップスクリプト内で行う。
  
 ===== Let's Encrypt 管理 ===== ===== Let's Encrypt 管理 =====
 ==== サーバ証明書の更新 ==== ==== サーバ証明書の更新 ====
 サーバ証明書の有効期間が 90日となっている。更新忘れが発生しないよう自動更新の設定を行う。 サーバ証明書の有効期間が 90日となっている。更新忘れが発生しないよう自動更新の設定を行う。
-  * [[https://letsencrypt.jp/command/​|Let'​s Encrypt 総合ポータル Let's Encrypt ユーザーガイド]]に従い、スクリプトを作成<​code>​+  * [[https://free-ssl.jp/docs/​using.html/​|Let'​s Encrypt 総合ポータル Let's Encrypt ユーザーガイド]]に従い、スクリプトを作成<​code>​
 #!/bin/sh #!/bin/sh
  
-/​usr/​local/​bin/​certbot renew --pre-hook "​service apache24 stop" --post-hook "​service apache24 start"+/​usr/​local/​bin/​certbot-3.6 renew --pre-hook "​service apache24 stop" --post-hook "​service apache24 start"
 </​code>​ </​code>​
   * prisoner web の /​etc/​periodic/​weekly に配置する   * prisoner web の /​etc/​periodic/​weekly に配置する
vps/vps4th2nd_08.txt · Last modified: 2019/07/13 18:56 by hoge@hoge