Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - Php and MySQL command add to the environment variable method in Linux system (Linux)

- Oracle 12CIN-memory in table spaces (Database)

- C # and JavaScript arrays to re-summary (Programming)

- Java Graphics2D Paint (Programming)

- numpy and SciPy installation under Python for scientific computing package (Linux)

- CentOS installation Docker series (Linux)

- How to clear the v $ archived_log view expiration information (Database)

- Nginx introduced Dynamic Module Architecture (Server)

- Linux administrator should command: sed and awk (Linux)

- DM9000 timing settings (Programming)

- Linux CPU Monitoring Index (Linux)

- VirtualBox modify the size of the virtual machine disk VDI (Linux)

- Enterprise-class GitHub warehousing environment build (Server)

- Whisker Menu 1.4.3 Install menu Linux (Linux)

- MySQL can not write the data keyword conflicts (Database)

- init level settings for Linux / etc / inittab file into six (restart) or does not support the level of solution (Linux)

- 3 tips Linux command (Linux)

- Kibana use installation (Linux)

- JDK installation under CentOS (Linux)

- Analysis of potential problems through custom Orabbix monitoring Oracle (Database)

 
         
  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 
fi
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 .... '
fi
echo' end backup db ... '


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

     
         
         
         
  More:      
 
- Linux program analysis tool: ldd and nm (Linux)
- To share Linux script automatically change passwords (Linux)
- VMware difference in three network connection (Linux)
- Enterprise Hadoop cluster architecture - DNS installation (Server)
- Hanoi problem Java Solution (Programming)
- Ordinary users how the Linux system shutdown (Linux)
- To restore the last time applications running when Ubuntu user log in again (Linux)
- Spring JDBC Comments (Programming)
- Android imitation UC browser scroll up and down functions (Programming)
- To upgrade combat MongoDB database replication sets and split versions (Database)
- Oracle to create an external table (Database)
- Ubuntu 14.04 install Sublime Text 3 plug and use SublimeClang (Linux)
- Volatile keyword in C language understanding (Programming)
- Linux environmental performance data acquisition system (Linux)
- CentOS cross compiler core Raspberry Pi 2 (Linux)
- Oracle 12C RAC on temporary table space Enlighten (Database)
- Java reflection mechanism explained in detail and Method.invoke explanation (Programming)
- Ganglia Python plug-in the process of writing notes (Linux)
- Formatting Java floating-point types (Programming)
- Docker Basic Concepts (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.