page contents
My new Blog under construction: Visit :
Linux is an open-source version of the UNIX operating system.Linux is named after Linus Torvalds,who introduced it!I am a Linux Student.In this blog i will be posting all what i learn about LINUX,OpenSource packages,web tools and what ever i found useful & intresting to be a linux system admin..!!!
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
/var/log/httpd/*log {Now you need to set a cronjob for the logrotation to run. crontab -e
monthly
rotate 52
compress
missingok
notifempty
sharedscripts
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
00 00 * * * /usr/sbin/logrotate -s /home/humanlinux/config/logrotate.status
Cron ensures that the command runs at midnight everyday. The command has three parts. /usr/sbin/logrotate is the path to logrotate. The -s /home/humanlinux/config/logrotate.status option specifies where logrotate keeps its status information. This file has to be writeable by the user running the cron.
/usr/sbin/logrotate -f /etc/logrotate.conf to begin the log rotationWe can assign swap area in linux either on a partition or a file.
I am creating here swap area using a file.
First we need to create the swap file.
dd if=/dev/zero of=/swapfile bs=1024 count=2000000
this will create a file 'swapfile' under / of size above 2gb
Type the following commands :-
mkswap /swapfile
swapon /swapfile
Now we can add the swap entry on fstab so that on every reboot, system will automatically loads the awap area.
vi /etc/fstab
append the following line to the bottom
/swapfile swap swap defaults 0 0
save and quit
To see the swap usage use the command top
thanks & regards
tell2humanlinux@gmail.com