shell 备份 source code
1. 利用shell脚本备份源码
首先mkdir创建三个目录 backup存放备份代码,script 存放shell脚本,www存放源码

2.创建文件

3. 编写shell脚本
#!bin/sh
basedir=/data/backup
www_src=$backdir/www_src/$(date +%F_%H%M)
[! -d "$www_src" ] && mkdir -p $www_src cd /data
tar -jpcf $www_src/www.tar.bz2 www

service crond restart 效果ok

shell 备份 source code的更多相关文章
- StreamSets学习系列之StreamSets支持多种安装方式【Core Tarball、Cloudera Parcel 、Full Tarball 、Full RPM 、Docker Image和Source Code 】(图文详解)
不多说,直接上干货! Streamsets的官网 https://streamsets.com/ 得到 https://streamsets.com/opensource/ StreamSets支持多 ...
- mysql常用备份命令和shell备份脚本
备份多个数据库可以使用如下命令:mysqldump -uroot -p123456 --databases test1 test2 test3 > /home/test/dump.sql; 恢复 ...
- How to compile and install Linux Kernel 5.1.2 from source code
How to compile and install Linux Kernel 5.1.2 from source code Compiling a custom kernel has its adv ...
- Website's Game source code
A Darkroom by doublespeakgames <!DOCTYPE html> <html itemscope itemtype="https://schem ...
- Tips for newbie to read source code
This post is first posted on my WeChat public account: GeekArtT Reading source code is always one bi ...
- 编程等宽字体Source Code Pro(转)
Source Code Pro - 最佳的免费编程字体之一!来自 Adobe 公司的开源等宽字体下载 每一位程序员都有一套自己喜爱的代码编辑器与编程字体,譬如我们之前就推荐过一款"神 ...
- How to build the Robotics Library from source code on Windows
The Robotics Library is an open source C++ library for robot kinematics, motion planning and control ...
- How to build windows azure PowerShell Source Code
Download any version source code of Windows Azure Powershell from https://github.com/Azure/azure-sdk ...
- akka cluster sharding source code 学习 (1/5) 替身模式
为了使一个项目支持集群,自己学习使用了 akka cluster 并在项目中实施了,从此,生活就变得有些痛苦.再配上 apache 做反向代理和负载均衡,debug 起来不要太酸爽.直到现在,我还对 ...
随机推荐
- nginx安装配置并布置网站
之前做的网站都是用的apache,关于apache和Nginx的区别也不说了,百度上也都有,而且apche和nginx可以共存,这个之后再说. 首先安装nginx,我用的云主机,直接用yum安装 #y ...
- Java学习笔记一:数据类型I
GitHub代码练习地址:https://github.com/Neo-ML/JavaPractice/blob/master/IntPractice1.java https://github.com ...
- Java-redis-雪崩优化
缓存失效的时候如下图: 解决办法"使用互斥锁(mutex key):下面是核心伪代码 v = memcache.get(key); if (v == null) { if (memcache ...
- Emmet/Zen Coding 快速入门说明
快速参考 以下是支持的特性: ele creates an HTML element tag 展开一个HTML元素标签 # creates an id attribute 作用于元素标签,展开一个id ...
- SVN+Axure版本管理&协同设计(一)
1. SVN介绍 2.安装部署 环境介绍:Ubuntu16
- 解决app安装成功后,直接点击“打开”再按home返回,再次打开app会重新启动的问题
在主activity的onCreate中加入以下代码 @Override protected void onCreate(Bundle savedInstanceState) { super.onCr ...
- Spring boot @EnableScheduling 和 @Scheduled 注解使用例子
前言 Spring Boot提供了@EnableScheduling和@Scheduled注解,用于支持定时任务的执行,那么接下来就让我们学习下如何使用吧: 假设我们需要每隔10秒执行一个任务,那么我 ...
- java泛型【收藏】
什么是泛型? 泛型(Generic type 或者 generics)是对 Java 语言的类型系统的一种扩展,以支持创建可以按类型进行参数化的类.可以把类型参数看作是使用参数化类型时指定的类型的一个 ...
- java.sql.SQLException: The SQL statement must not be null or empty.这个错误
今天发现了这个错误 java.sql.SQLException: The SQL statement must not be null or empty. 并且看了些网页:综合说下这个错误. 一般都是 ...
- Spring cloud的Maven插件(一):repackage目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...