Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - mysqldump issue a note (Database)

- Linux Kernel 4.2.2 compiler installation tutorial (Linux)

- Some common Linux commands Study Notes (Linux)

- Linux System Getting Started tutorial: Ubuntu desktop using the command line to change the system proxy settings (Linux)

- Teach you the Ubuntu Server enabled SSH multifactor authentication (Server)

- CentOS 7 source code to compile and install PHP5.6 Nginx1.7.9 and MySQL (LNMP build environment) (Server)

- The most concise Systemd tutorial, just ten minutes (Linux)

- MySQL combination Git achieve differential backups can be used in the production environment (Database)

- C ++ 11 feature: auto keyword (Programming)

- Linux detection command (vmstat) (Linux)

- CentOS 7 RHEL 7 to reset the root password (Linux)

- PostgreSQL transaction model introduction (Database)

- Linux security settings Basics (Linux)

- Usage Linux device tree (Programming)

- Zabbix monitoring disk IO status (Server)

- Briefly explain the invasion of the four-level denial of service attack DoS Linux server (Linux)

- Linux Getting Started tutorial: XWindow what (Linux)

- To deploy MySQL database with separate read and write OneProxy (Database)

- To install Python-Pip and Fabric under CentOS / Ubuntu (Linux)

- Android memory optimization of the memory cache (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 network monitoring tools ntopng installation (Linux)
- Ordinary users how to use the firewall software (Linux)
- Linux system security knowledge (Linux)
- Ubuntu 12.04 installation instructions under GAMIT10.40 (Linux)
- JavaScript function closures Quick Start (Programming)
- Objective-C basic program structure (Programming)
- VirtualBox installation enhancements let the mouse move and share CentOS 6.4 (Linux)
- Machine Learning: Classification of the curse of dimensionality (Programming)
- MySQL and MariaDB new master from the cluster configuration GTID (Database)
- Compile and install LNMP under CentOS 6.5 (Server)
- On the Web application attack techniques Common (Linux)
- Features and prevention methods elaborate network security grayware (Linux)
- The callback function used in C ++ (Programming)
- MongoDB query timeout exception SocketTimeoutException (Database)
- Linux create and delete user step (Linux)
- Ubuntu 14.04 jdk Installation and Configuration (Linux)
- Compiled version of Android Opus audio codec library method (Programming)
- Nginx + Tomcat static and dynamic load balancing and separation configuration essentials under Linux (Server)
- What happens after the MySQL disk space is full (Database)
- floating IP in OpenStack neutron (Server)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.