Usually the log files are more full, like a proper rebooting machine such as the obian system accumulation of trash files that is released after larger rebooting and viewing cd/var/log ls-lh in M or du-csh/opt// var/log to see the occupancy size of the opt and log folders.
![]()
1.df-h: View the use of hard drives by df-h command: it was found that the Vda3 mount point is almost full [this or processed, before reaching 49G]
2. Knowing that the hard drive is full, the next step is to start looking for big files on the server, starting with root directories and finding more space in home folders by order du-h-max-depth=1.
cd ./home, then search down by d-h-max-depth=1 command, and eventually find that oracle is occupying more space
du -sh *This command is also used to look at the size of the files and folders under the current directory, and then to carefully search for the log files and find a higher occupancy of the lister.org, which leads to problem solving:
The online search revealed that this file had slowed down the pace of database sql and could lead to unsuccessful connections with visual tools such as plsql, which are recorded below: 1. Rename file: mv listener.log lister.old20180917 2. Re-opening the listinger.log will automatically generate a new document:lsnrctl set log_status on 3.
Requirements: Delete the log file 10 days ago in a folder? (types.log)
Specific steps:
Ask if there is a request for log asking
find /home/rab/hhy/test/ -mtime +10 -name “*.log” -exec ls -l {} \;
There is an execution deletion(Designation requires caution) find /home/rab/hy/test/-mtime +10 -name “*.log” -exec rm -rf ⁇ ; details: /home/rab/hhy/tist/: preparation directory – mtime: search by day -mmin: click by minute; +9: search for documents 10 days ago, current time 0 “*.*: type of data desired, ** for any document -exec: fixed writing rm-ref: mandatory deletion of files, including directories ⁇ ; fixed writing, 1 pair of brackets + spaces / ++;
Demand: Search for log files greater than 5M?
find /home/rab/hhy/test/ -type f -size +5M
或
find /home/rab/hhy/test/ -type f -size +5120k
Delete:
find /home/rab/hhy/test/ -type f -size +5120k -exec rm -rf {} \;
Use curtab to plan the task-cleaning system cache
#cleanchaches1.sh #!/bin/bash # echo “start clearing the cache” sync; sync # write hard disk to prevent data loss > /proc/sys/vm/drop_caches #cleancaches2.sh #! /bin/sh used=`free -m | awk ‘NR==2’ | awk ‘{print $3}’` free=`free -m | awk ‘NR==2’ | awk ‘{print $4}’` echo “===========================” >> /tnwmall/memory/logs/mem.log date >> /tnwmall/memory/logs/mem.log echo “Memory usage before | [Use:${used}MB][Free:${free}MB]” >> /tnwmall/memory/logs/mem.log if [ $free -le 2000 ] ; then sync && echo 1 > /proc/sys/vm/drop_caches sync && echo 2 > /proc/sys/vm/drop_caches sync && echo 3 > /proc/sys/vm/drop_caches used_ok=`free -m | awk ‘NR==2’ | awk ‘{print $3}’` free_ok=`free -m | awk ‘NR==2’ | awk ‘{print $4}’` echo “Memory usage after | [Use:${used_ok}MB][Free:${free_ok}MB]” >> /tnwmall/memory/logs/mem.log echo “OKAY” >> /tnwmall/memory/logs/mem-okay.log else echo “Not required” >> /tnwmall/memoory/logs/mem-required.log fi exit 1 Add planned tasks crontab-e 15 8*/1* /usr/bin/python3 / root/guo/ caiji_wordpress_chinanews_ok.py >> /root/guo/cron-caiji.log 2>&1 15 9 */1 * * /root/cleanaches1.sh >> /root/cleanaches1.log 2>&1 15 10 */1 * * /root/cleanaches2.sh >> /root/cleanaches2.log 2>&1
未经允许不得转载:萌萌Apprentissage » The linux system maintains the server's disk-filled processing method
linux One Chinese script
Google shell enable enhanced mode 4 nuclear 16G RAM
Tmux use tutorial
Screen's summary
I'm gonna get you a new one, shell.cloud.google on the line.
Linux Memory Clearing