Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6548512
  • 博文数量: 1005
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13071
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(1005)

文章存档

2020年(2)

2019年(93)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: LINUX

2019-04-03 11:09:32


#!/bin/bash
backup_date=`date "+%Y_%m_%d"`
delete_date=`date +%Y_%m_%d -d "7 days ago"` 
backup_log=/home/yeemiao/shell/logs/gitlab_backup_${backup_date}.log


gitlab-rake gitlab:backup:create >${backup_log}

file_cnt=`find /var/opt/gitlab/backups -name "*${delete_date}*_gitlab_backup.tar"|wc -l`
echo $file_cnt
if [ $file_cnt -gt 1 ]
then
  find /var/opt/gitlab/backups -name "*${delete_date}*_gitlab_backup.tar"|xargs rm
fi
阅读(1942) | 评论(0) | 转发(0) |
0

上一篇:archer docker安装部署

下一篇:sonarqube安装

给主人留下些什么吧!~~