Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - For the FreeBSD install Adobe Flash plug-in (Linux)

- Installation salt-minion on RHEL5 (Linux)

- Installation of Python2.7.10 under CentOS 6.4 (Linux)

- JavaScript notes --Objects (Programming)

- Linux system on a virtual machine to access the Internet (Linux)

- How to disable IPv6 on Ubuntu, Linux Mint, Debian (Linux)

- Docker Build a Java compiler environment (Linux)

- socket busy poll of Linux kernel 3.11 to avoid sleep switch (Linux)

- Oracle conditional select statements and looping statements (Database)

- To see the Linux device tree (Linux)

- Linux see whether there is a hacker program (Linux)

- CentOS 6.x and CentOS7 install MPlayer (Linux)

- Binary tree and some basic operations with binary list (Programming)

- TypeScript basic grammar (Programming)

- Understanding Java classes (Programming)

- Retro terminal in Linux (Linux)

- Oracle 12C modify spfile path (Database)

- The basic principles of AIX system security (Linux)

- Install Visual Studio Code in Ubuntu (Linux)

- Linux platform host to prevent hacking skills (Linux)

  Nginx log cutting and MySQL script regular backup script
  Add Date : 2018-11-21      

Most of the diaries of the same cut and backup mechanism: The following script is Nginx cutting diary
# / bin / bash
logpath = '/ home / nginx / log'
nglogs = '/ opt / nginx / logs
mkdir -p $ logpath / $ (date +% Y) / $ (date +% m)
mv   $ nglogs / access.log   $ logpath . / $ (date +% Y) / $ (date +% m) / access $ (date +% Y% m% d) .log
mv   $ nglogs / error.log   $ logpath / $ ( date +% Y) / $ (date +% m) / error. $ (date +% Y% m% d) .log

kill -USR1 'cat /opt/nginx/logs/nginx.pid'
kill -USR 'cat /opt/nginx/logs/nginx.pid'  achieve diary through automatic signal USR nginx switching scheme

periodic backups of MySQL program:!
# / Bin / sh
echo 'start backup db ...'
DM = `date +% a`
if [ -f /opt/backup/xxx.$DM.dmp]; then
    mv /opt/backup/xxx.dmp    mv /opt/backup/xxx.dmp.old 
mysqldump -h ipaddress --password = xxxx > /opt/backup/xxx.dmp
if [$ -eq 0 -a -f / home / smecloud / db_backup / kdrive?. $ DM.dmp.old]; then
    rm /home/smecloud/db_backup/kdrive.$DM.dmp.old
    echo 'backup xxx ok .... '
echo' end backup db ... '

date of the common parameters:
date +% Y Year
date +% m month
date +% d Day
date +% a week

- Linux garbled file delete method (Linux)
- MySQL high availability cluster fragmentation of deployment uses Fabric (Database)
- Shell script to crawl through AWR SQL Report Problems (Database)
- swap space is insufficient cause OOM kill MySQL Case (Database)
- Ubuntu 12.04 LTS installation configuration JDK1.6.0_45 (Linux)
- Approach the next Linux shared interrupts (Linux)
- DRBD Principle and Features Overview (Server)
- Sublime Text 3 best features, plug-ins and settings (Linux)
- Linux disk virtualization (Linux)
- Difference Docker mirror and containers (Server)
- Via Twitter how open source library to be used anywhere Emoji emoticons (Linux)
- Sshuttle A VPN-based transparent proxy that uses ssh (Server)
- CentOS 6.4 OpenNebula installation (Linux)
- Binary search -Java achieve (Programming)
- The FreeBSD zfs: failed with error 6 Error Resolution (Linux)
- Zabbix monitoring disk IO status (Server)
- Linux Man Page Installation (Linux)
- Android start automatically and add and delete a desktop shortcut (Programming)
- Two minutes thoroughly so that you understand Android Activity Lifecycle (Programming)
- Installation Enpass secure password manager on Ubuntu (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.