常用文件备份

Posted 小智RE0

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了常用文件备份相关的知识,希望对你有一定的参考价值。

log4j.properties配置文件

log4j.rootLogger = debug,stdout,D
#System out Console
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = [%p] %dyyyy-MM-dd HH:mm:ss,SSS %m%n

#System out File
log4j.appender.D = org.apache.log4j.FileAppender
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.File = E://logs/log.log
log4j.appender.D.Append = true
log4j.appender.D.layout = org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern = %dyyyy-MM-dd HH:mm:ss  [ %t:%r ] - [ %p ] -[%l] %m%n

springxml配置文件头

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        https://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd">
        
</beans>

数据配置文件database.properties

driverClassName=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/day20211126_manage_db?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
user=root
pwd=123456
initialSize = 5
maxActive = 10

mapper.xml配置文件头

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--注意 这里对应空间为持久层映射接口-->
<mapper namespace="com.xiaozhi.backserver.startspringboot.dao.UserDao">

</mapper>

springboot.yml配置文件

#修改端口号
server:
  port: 5277

#jdbc连接以及数据源配置;
spring:
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/firstweb_db?useUnicode=true&characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
    username: root
    password: 123456
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
    filters: stat
    initialSize: 5
    minIdle: 1
    maxActive: 20

#集成整合mybatis;
mybatis:
  type-aliases-package: com.xiaozhi.backserver.startspringboot.model
  mapper-locations: classpath:mapper/*Mapper.xml
  configuration:
    map-underscore-to-camel-case: true
cache-enabled: true

# 日志打印;
logging:
  level:
    com.xiaozhi.backserver.startspringboot.dao: trace
  file:
   name: E:\\\\logs\\\\log.log

以上是关于常用文件备份的主要内容,如果未能解决你的问题,请参考以下文章

PHP常用代码片段

常用python日期日志获取内容循环的代码片段

记录C#常用的代码片段

Mac小知识:文件备份和清理常用工具的安装和配置

C#常用代码片段备忘

Oracle数据库从RMAN备份集片段还原指定单个归档日志进行日志挖掘分析