Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - Nodejs mysql pool Example (Programming)

- Grub2: Save Your bootloader (Linux)

- Android application simulates the phone keypad (Programming)

- To configure linux transparent firewall (Linux)

- How do I upgrade from Ubuntu 15.04 to Ubuntu 15.10 (Linux)

- Use MD5 transform algorithm to prevent exhaustive decipher passwords (Linux)

- Getting Started with Linux system to learn: how to configure a static IP address for CentOS7 (Linux)

- Ubuntu program using the Sound Recorder (Linux)

- Github inventory objects Algorithm (Linux)

- Windows environment Android Studio v1.0 Installation Guide (Linux)

- J2EE Example of Filter (Programming)

- Laravel 4.2 Laravel5 comprehensive upgrade Raiders (Server)

- Github with .gitignore ignore specified file (Linux)

- Give your photos Instagram style filters plus program in ubuntu (Linux)

- Linux, Chrome browser font settings beautification (Linux)

- Django 1.8 TEMPLATE_DIRS configuration and STATICFILES_DIRS (Server)

- ASM Management - How to Rename diskgroup (Database)

- Linux security concerns again (Linux)

- To install GCC development environment under SUSE11 (Linux)

- Programmer editor Vim (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:      
 
- Virtual Judge environment to build and configure under Ubuntu (Server)
- Puppet 3.5 Source package Installation and Configuration (Server)
- How to cool down your Ubuntu system (Linux)
- Ubuntu install code editor Sublime Text 3 (Linux)
- MySQL root password reset under CentOS (Database)
- Linux uses shared memory communication process synchronization Withdrawal (Programming)
- Mac OS X Server installation and application (Linux)
- Root of AVL Tree- achieve balanced search trees AVL tree (Programming)
- Eight sorting algorithm implemented in Python (Programming)
- CentOS 7.0 Close firewall is enabled by default iptables firewall (Linux)
- Linux screen command (Linux)
- Ubuntu15 core CLR (Server)
- Elaborate .NET Multithreading: Using Task (Programming)
- ActiveMQ configuration Getting Started Tutorial (Server)
- Erlang concurrency and foundation (Programming)
- Java 8 stream parsed into SQL (Programming)
- Use dump restore mode fast backup and recovery system FreeBSD (Linux)
- Linux suffered SYN flood attack setting (Linux)
- Shell Programming points to note about the function (Programming)
- Oracle 11G R2 DataGuard structures (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.