Archive for the tag 'deleting'

SBDavid

Deleting Stats logs daily in cPanel

Deleting Stats logs daily in cPanel

Deleting Stats logs is something that is enabled on most servers but one does encounter servers with a full domlogs directory. To delete those logs you can follow these steps.

First step is to check how large are the apache domain logs, you can check those on a cPanel server by running “du -hs /usr/local/apache/domlogs”. If the size of those logs is large, then you may want as much free space as possible. Login to WHM and click Tweak Settings. Within that menu click “Delete each domain’s access logs after stats run” which will enable this and click ‘Save’. Now at the end of the stats run every night it will wipe out the directory so you should not have the logs grow very large, unless of course your server is very busy.

Instructions for deleting the swap file after import in Ensim

Eg. partition - /dev/hda3 mounted on /, swap file - /var/swapfile.

Turn off swapping for file “/var/swapfile” with the following command:

swapon, swapoff - enable/disable devices and files for paging and swapping

Swapoff disables swapping on the specified devices and files. When the -a flag is given, swapping is disabled on all known swap devices and files (as found in /proc/swaps or /etc/fstab)

#swapoff /var/swapfile

Delete the file “/var/swapfile” with the following command:

#rm -f /var/swapfile

Script for deleting all the mails in Qmail

1. create a file with the following statements, say delqmail

service qmail stop
find /var/qmail/queue/mess -type f -exec rm {} \;
find /var/qmail/queue/info -type f -exec rm {} \;
find /var/qmail/queue/local -type f -exec rm {} \;
find /var/qmail/queue/intd -type f -exec rm {} \;
find /var/qmail/queue/todo -type f -exec rm {} \;
find /var/qmail/queue/remote -type f -exec rm {} \;
service qmail start

You may also include the directories like /var/qmail/queue/mess/bounce… etc.

2. Give executable permission to this file

chmod 755 delqmail

3. Execute the script

sh -x delqmail