Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - Linux user login and IP restrictions (Linux)

- Lsblk command lists using Linux block device information (Linux)

- Basic Operation Linux files and directories (Linux)

- Based AutoYaST automated installation of SUSE practice (Linux)

- CentOS 6.5 installation configuration DRBD (Server)

- Linux daemon (Linux)

- Linux based serial programming (Programming)

- Install Open vSwitch under CentOS 6.5 (Linux)

- Linux kernel to achieve soft RPS network to receive soft interrupt load balancing to distribute (Linux)

- MySQL to NoSQL avatar (Database)

- Use OpenSSL to generate a certificate detailed process (Linux)

- jobs command example (Linux)

- CentOS cross compiler core Raspberry Pi 2 (Linux)

- Linux Network Programming - non-blocking program (Programming)

- GDB remote connections RX Probe online debug program (Programming)

- How to use systemd timer (Linux)

- PXE + Kickstart automatically install CentOS 6.5 (Linux)

- Linux System Getting Started Tutorial: How do you know Shell which is currently being used (Linux)

- PL / SQL data types (Database)

- Hadoop upload files error solved (Server)

 
         
  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:      
 
- installation of Vim plugin YouCompleteMe under Ubuntu 15.04 (Linux)
- Java filter (Programming)
- How to Install 3.16.7 CKT2 kernel in Ubuntu 14.10, Ubuntu 14.04 and its derivative versions (Linux)
- See Linux kernel, CPU, memory, and various versions of the command module and means (Linux)
- Cross server / client backup command: rsync use (Server)
- Ubuntu install perfectly handsome terminal Guake 0.8.1 (Linux)
- Ubuntu under shadowsocks configuration instructions (Linux)
- Method under Linux GCC Compiler shared library function export control (Programming)
- Linux cd command Detailed (Linux)
- Ubuntu Froxlor Server Administration panel installation (Server)
- RHEL5 multipath configuration (Linux)
- C # Future: Tracking null reference (Programming)
- ORA-00020: No more process state objects available (Database)
- Fedora 22 install Adobe Flash Player (Linux)
- DataGuard add temporary data files bug (Database)
- Linux data recovery software efficiently practical application extundelete (Linux)
- Java concurrent programming using the synchronized keyword ReentrantLock alternative primitive (Programming)
- Ubuntu install the camera driver (Linux)
- Everyone should know something about TCP (Linux)
- [Android] Eclipse does not update the Android SDK Manager solution [using GoAgent] (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.