Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - Linux Network Programming - raw socket can do (Programming)

- Ubuntu is not in the sudoers file problem solving (Linux)

- MySQL5.7.10 installation documentation (Database)

- 6 common PHP security attacks (Linux)

- Laravel 4 Expansion Pack (Server)

- Linux using RAID how to use Mdadm Tool Management Software RAID (Linux)

- Generated characters using Java Videos (Programming)

- Docker data container protection the pros and cons (Server)

- PHP file upload methods exist in the database (Programming)

- Number JavaScript type system (Programming)

- Java semaphores (Programming)

- Ubuntu install Avast antivirus software (Programming)

- Ten to improve the efficiency of the Linux bash tricks (Linux)

- Ubuntu 15.10 under Python + Apache + CGI fully configured (Server)

- Deploy the project to the server from GitHub (Server)

- top command causes the system load increases (Linux)

- grep command Detailed and relevant examples (Linux)

- HTML5 postMessage cross-domain data exchange (Programming)

- RedHat command line and graphical interface switching (Linux)

- Use ISO document production OpenStack used CoreOS mirror (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:      
 
- Install Ruby on Rails in Ubuntu 15.04 in (Linux)
- Python context managers (Programming)
- Eclipse-4.4 crash problem solving under Debian-7.6 (Linux)
- How to install Go1.5 source development environment on Mac (Server)
- Django Web dynamic three linkage (Programming)
- Build Python3.4 + PyQt5.5.1 + Eric6.1.1 development platform under Mac OS X 10.11.1 (Server)
- PHP call a Python program (Programming)
- VMware ghost Linux card error (Linux)
- Ubuntu users to install voice switch instructs the applet (Linux)
- Ubuntu 14.04 virtual machine switching desktop environments (Linux)
- ActiveMQ5.11.1 and JDK version matching relation (Linux)
- To execute the cp command prompt type skip folder under CentOS (Linux)
- Linux regex awk Comments (Linux)
- MongoDB configuration in Ubuntu 14.04 (Database)
- Java Graphics2D Paint (Programming)
- Linux command find (Linux)
- SME Linux network security policy server security (Linux)
- blecat: Bluetooth Gadgets (Linux)
- Python several standard types of built-in functions (Programming)
- Using Oracle for Oracle GoldenGate to achieve a one-way data synchronization (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.