Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - Oracle database import and export (Database)

- Haproxy multi-domain certificate HTTPS (Server)

- Install Mac OS X 10.9 systems VMware10 (Linux)

- C ++ CBitmap, HBitmap, Bitmap difference and contact (Programming)

- To install Samba server on CentOS 6.6 (Server)

- Linux / BSD firewall M0n0wall Profile (Linux)

- 32-bit and 64-bit integer in PHP and MySQL range (Database)

- Oracle11g Trigger Debugging Record Error: PLS-00201: identifier SYS.DBMS_SYSTEM 'must be declared (Database)

- Linux server startup and logon security settings (Linux)

- Ubuntu install driver manager Mint Driver Manager and Device Driver Manager (Linux)

- Android source code compiled fatal error solutions (Programming)

- Postgres-X2 deployment steps (Database)

- Struts2 form of non-use component tags (Programming)

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

- New features of Java 9 HTTP2 and REPL (Programming)

- How to achieve SSH without password login (Server)

- CentOS 7 How to install MySQL Server (Database)

- RPM package management tools under Linux (Linux)

- Introduces Linux kernel compilation system and compiler installation (Linux)

- Linux System Getting Started Tutorial: Five image processing software (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

- Ubuntu resolve sudo: source: command not found error (Linux)
- The best tools and techniques to find data on a Unix system (Linux)
- Ubuntu install driver manager Mint Driver Manager and Device Driver Manager (Linux)
- To create someone else can not afford to delete the administrator user (Linux)
- Use virt-manager to create and manage virtual machines (Linux)
- By creating a personal technology blog Detailed GitHub (Linux)
- Android project using the command to create and install the package (Programming)
- Linux Log (Linux)
- CentOS 6 Install Linux kernel source (Linux)
- How to find out a Unix system library files are 32-bit or 64-bit (Linux)
- Linux system security settings (Linux)
- Linux script to copy the folder to all folders with the same name (Linux)
- Oracle DATABASE LINK (DBLINK) Create (Database)
- Java factory pattern (Factory mode) (Programming)
- Docker command Detailed (Linux)
- Debian 8 (amd64) installation deployment Memcached management tools MemAdmin (Server)
- Intruder tools Knark Analysis and Prevention Linux environment (Linux)
- RHEL 5.7 Yum configure local source [Errno 2] No such file or directory (Linux)
- 8 Docker knowledge you may not know (Server)
- Retro terminal in Linux (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.