Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Nginx log cutting and MySQL script regular backup script     - Tune in high resolution to 1280x800 in Fedora 14 (Linux)

- Sublime Text 3 shortcuts summary (Linux)

- Ubuntu 10.04 to Ubuntu 10.10 Upgrade (Linux)

- 30 Practical Linux system administrators will learn the command (Linux)

- Linux to achieve a simple cp command (Linux)

- TNS-03505 name could not be resolved (Database)

- Linux SVN account password to save your settings (Linux)

- Linux (RHEL5) general optimization system security (Linux)

- ASM required disk format process in Solaris platforms (Linux)

- Linux Getting Started tutorial: Experience VirtualBox Virtual Machine chapter (Linux)

- Install Jetty on CentOS / RHEL 6.X (Server)

- Quickly locate the mistakes by gdb location (Programming)

- Git uses Details (Linux)

- How to install Ubuntu California - the calendar application (Linux)

- Close common port to protect server security (Linux)

- How do I cancel (almost) any operations in Git, (Linux)

- Linux filtration empty file command summary (Linux)

- CentOS x86 64bit upgrade to 2.7 Python2.6 (Linux)

- Getting Started with Linux system to learn: how to get the process ID (PID) in the script (Linux)

- How Ubuntu Snappy Core 2 running on Raspberry Pi (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

- BusyBox making the file system (Linux)
- C ++ inheritance and derived (induction principle) (Programming)
- Ubuntu install Eclipse can not find JAVA_HOME problem (Linux)
- The first deployment of cross-platform operation Rafy record (Server)
- Atlassian Linux Shell Scripting the confluence remote backup methods (Linux)
- To install Git on Ubuntu systems (Server)
- Linux Command - ps: a snapshot of the current process (Linux)
- MyCAT log analysis (Database)
- Five strokes to find out the IP address you want to know (Linux)
- Linux, ls command to achieve (Linux)
- Linux argument references and command substitution (Linux)
- Three minutes to teach you to easily grasp the grep command regular expression (Linux)
- Node.JS different ways to install under Ubuntu 15.04 (Linux)
- Linux file system (inode and block) (Linux)
- Expert advice: Do not use the computer security IE browser (Linux)
- C ++ precision performance test function (Programming)
- Ordinary users how to use the firewall software (Linux)
- Linux, how to filter, split, and merge pcap file (Linux)
- Java enum use (Programming)
- Bash How to read a file line by line (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.