Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - Bug tracking library after FastJson omitted the decimal point 0 (Programming)

- Java Cookie Comments (Programming)

- PostgreSQL use pgpool achieve high availability (Database)

- Linux / Unix desktops interesting: Christmas tree on the terminal (Linux)

- How to configure Apache Solr on Ubuntu 14/15 (Server)

- Use Swift remove the spaces in the string (Programming)

- Fedora10 use Git version Configuration Management (Linux)

- Using Python to find a particular file extension directory (Programming)

- Linux supports serial output method (Linux)

- RHEL5 multipath configuration (Linux)

- Why is better than Git SVN (Linux)

- ImageMagick Tutorial: How to cut images in Linux command line (Linux)

- Drawing from the Android source code analysis View (Programming)

- QEMU image file used: qcow2 and raw (Linux)

- Linux system server network security management tips (Linux)

- Traffic monitor Linux Python Version (Programming)

- Nginx configuration support f4v video format player (Server)

- Find details block device with Linux blkid command (Linux)

- Security implementation of disk data protection under Linux (Linux)

- Install Ruby on Rails in Ubuntu 15.04 in (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 
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:      
 
- The Definitive Guide to Linux NAT network connection (Linux)
- Ten linux version of the system (Linux)
- Echo Command Examples (Linux)
- Virt Related Command Summary (Linux)
- Ubuntu 14.10 / 14.04 how to install Quick Start tool Mutate 2.2 (Linux)
- Difference Docker mirror and containers (Server)
- Oracle Client Easy Connection error ORA-12154, TNS-03505 (Database)
- To create a file in Linux directory by setfacl (Linux)
- After you change the GRUB boot disk partition repair (Linux)
- FreeBSD install Gnome 3 Desktop (Linux)
- Why everybody ought to know LLVM (Linux)
- Mhddfs: multiple smaller partitions into one large virtual storage (Linux)
- Use OpenWrt build WDS wireless network extension on V2 WHR-G300N (Linux)
- PHP CURL get cookies simulated login (Database)
- C # get the current screenshot (Programming)
- Linux System Getting Started Learning: modify environment variables in Linux PATH (Linux)
- Ubuntu 12.04 installation DHCP Server (Server)
- MySQL import large amounts of data (Database)
- What is a logical partition management LVM, how to use in Ubuntu (Linux)
- RHEL7.0 log system (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.