In the past, we were Gitlab Docker plus a large directory on the local disk to run. However, the data backup is very important, or in case the data is not in the day, afraid of fear in the event.
How to back up, we can choose timing, how a timing method, as follows:
# Gitlab Scheduled Backup * * * *
cd/opt/gitlab/&& rsync-avzp. soft.ops.ac.cn::opsbak/gitlab/0800/1>/var/log/r Sync.0800.log 2>&1 * * *
cd/opt/gitlab/&& rsync-avzp. SOFT.OPS.AC.CN::OPSBAK/GITLAB/2000/1&G T;/var/log/rsync.2000.log 2>&1
*/7 * * cd/opt/gitlab/&& rsync-avzp. Soft.ops.ac.cn::opsbak/gi Tlab/1w/1>/var/log/rsync.1w.log 2>&1
*/30 * * cd/opt/gitlab/&& rsync-avzp. soft.ops.ac.cn :: Opsbak/gitlab/1m/1>/var/log/rsync.1m.log 2>&1
Rsync Server Configuration
[Opsbak]
Path =/data/bak/
hosts allow = 0.0.0.0/0
list = yes
uid = root
gid = root
read = False
log File =/var/log/rsyncd.opsbak.log
So after one months, we've got 4 backups.
* Every morning 8 o'clock
* Daily 8 o'clock in the evening
* 3 o'clock in the morning per week
* Every month 3 o'clock in the morning
But this place has a parameter is not afraid to use, is –delete, because this parameter means that if the file is deleted in the source directory, then the B directory will also do this action, meaning that the target and the source is fully synchronized.