0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

備忘録 CentOS7 crontabでRedmineとGitLabを毎日バックアップ

Last updated at Posted at 2018-07-31

centOS上で動いている RedmineとGitLabを自動でバックアップしたくて色々調べた結果

crontabとやらでゴニョゴニョするとできる

現状確認

crontab -l

何も設定してないと

no crontab for root

登録を行う

crontab -e

vimが開くので

例えば

0 0 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create

分 時 日 月 曜日 コマンド

で毎日 0時0分にGitLabのバックアップができます。

テキストファイルで

cp -r /var/opt/gitlab/backups /backups(バックアップ先フォルダ)

xxx.sh保存

できとうな場所に置いて

crontab -e
0 0 * * * xxx.sh

で登録すれば毎日バックアップできる!

失敗してたら権限を

chmod u+x xxx.sh 
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?