What need to delete on my server after a long time?

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,324
Points
63
Hi everyone,
What need to delete on my server after a long time? for example temporary files, folders, tickets, logs data files...etc to save memmory and speed up for server or websites? please share your experience?
 

AlbaHost

Well-known member
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
618
Points
43
Do you have any control panel installed? If so which one?
 

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,324
Points
63
I have installed directadmin on my server, not sure which to delete so...needing some advice.
 

AlbaHost

Well-known member
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
618
Points
43
Best answer
Directadmin logs are saved as below:

DirectAdmin Locations of Logs
These are the locations of common logs on DirectAdmin servers – accessing these logs will require root SSH access.

DirectAdmin Logs
These are the log files for DirectAdmin itself.
LocationDescription
/var/log/directadmin/error.logGeneral errors for DirectAdmin's service (directadmin.service)
/var/log/directadmin/errortaskq.logDirectAdmin's internal task queue errors
/var/log/directadmin/system.logSystem-service reloads, quota tallies, Let's Encrypt status, etc. are logged here
/var/log/directadmin/login.logAdmin, Reseller, and User level successful and failed logins to the panel
/var/log/directadmin/security.logExecution of DirectAdmin's plugins

Apache (webserver) Logs
Apache is the default webserver on DirectAdmin servers. {domain.tld} refers to the domain in question – if you are looking for the general logs for my-cool-site.com, they would be located at /var/log/httpd/domains/my-cool-site.com.log .
Because LiteSpeed Enterprise Webserver is a drop-in replacement for Apache, LiteSpeed uses Apache's logs / logfile locations for it's own logs as well.
LocationDescription
/var/log/httpd/error_logGeneral Apache Error Logs
/var/log/httpd/access_logGeneral Access Logs
/var/log/httpd/suexec_logSuEXEC Logs
/var/log/httpd/fpexec_logFpExec1) Logs
/var/log/httpd/domains/{domain.tld}.logDomain-Specific Access Logs
/var/log/httpd/domains/{domain.tld}.error.logDomain-Specific Error Logs

CustomBuild
CustomBuild is used on DirectAdmin servers to build Apache, PHP, Exim, Dovecot, etc. Installations, removals, updates, and other calls to CustomBuild (i.e. rewriting/updating configuration files) are logged. It's log location is below:
LocationDescription
/usr/local/directadmin/custombuild/custombuild.logLog of installations (etc.) through CustomBuild

PHP-FPM Logs
If PHP-FPM is in use, it's logs can be found in the locations below for the various versions of PHP installed on the server.
LocationDescription
/usr/local/phpXX/var/log/php-fpm.logPHP-FPM logs: each version of PHP will have it's own logs. See example below.
/usr/local/php73/var/log/php-fpm.logPHP-FPM logs for PHP 7.3
/var/log/php-fpm73.logThis is a symbolic link to the above file – useful as a shortcut!

Nginx Logs
If Nginx is installed and in-use as a reverse-proxy or as the primary webserver, it's logs will be found in the locations below.
LocationDescription
/var/log/nginx/access_logGeneral Nginx access logs
/var/log/nginx/error_logGeneral Nginx error logs
/var/log/nginx/modsec_audit.logModSecurity rule-processing)
/var/log/nginx/domains/{domain.tld}.logNginx logs for specific domains are logged on this path
/var/log/nginx/domains/{domain.tld}.error.logNginx error logs for specific domains are logged on this path

FTP Logs
PureFTPd is the default FTP server on DirectAdmin, and ProFTP is available.
LocationDescription
/var/log/messagesGeneral FTPd errors are logged in the system's main log
/var/log/pureftpd.logPureFTPd general logs
/var/log/proftpd/access.logIf ProFTP is installed, this is where general access is logged
/var/log/proftpd/auth.logIf ProFTP is installed, this is where login attempts are logged

Dovecot (POP3 & IMAP) Logs
Dovecot is the POP3/IMAP server, and also handles local mail delivery3) once email has been received from Exim.
Location
/var/log/maillogPOP3/IMAP logins
var/log/dovecot-lmtp.logDelivery of emails to local accounts
/var/log/dovecot-lmtp-errors.logErrors with delivery of local email (i.e. mailbox is over quota)

Exim (SMTP) Logs
Exim is the SMTP server and Mail Transfer Agent4) on DirectAdmin servers.
LocationDescription
/var/log/exim/mainlogMain delivery and receipt log
/var/log/exim/paniclogUnexpected/Fatal error log
/var/log/exim/processlogProcess logs
/var/log/exim/rejectlogIncoming-email Rejection logs

NameD (DNS) Logs
The internet-standard BIND is DirectAdmin's DNS server – it is commonly referred to by the system's name named.
LocationDescription
/var/log/messagesBIND (named.service) logs to the main system log

Cron Logs
Cron jobs are executed by the cron daemon, and it's log location is listed below.
LocationDescription
/var/log/cronCron daemon logs

MySQL / MariaDB Logs
By default, only the MySQL / MariaDB general error log is enabled to reduce overhead. Replace {SERVERS_HOSTNAME} with the hostname of your server. The general logs and slow-query logs can be enabled from a root MySQL session.
LocationDescription
/var/lib/mysql/{SERVERS_HOSTNAME}.errMySQL startup and error log


ie: echo > /var/log/exim/rejectlog

for each path/directory.
 

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,324
Points
63
David Beroff
I see that log files are not weight and don't consume more diskspace to delete. I want to find temporary files to delete and free up space for my server or resource.
 

AlbaHost

Well-known member
Moderator
Hosting Provider
Joined
Jan 18, 2017
Messages
618
Points
43
AlbaHost
Then use this:

Code:
du -sh /*/ 2>/dev/null | sort -rh | head -n 10
will find the big file/folder, cd to that folder and use:

Code:
for X in $(du -s * | sort -nr | cut -f 2); do du -hs $X ; done
and delete them.
 

harry_v

Member
Registered
Hosting Provider
Joined
Dec 20, 2017
Messages
15
Points
3
You should first check which exact file folder is using more space.

Login to your server and run

du -csh /*

It will show you the size of each file and folder.

IDentify the file/folder and then see if it is not in use. It is how one can remove larger files that are not in use. It is not at all recommended to remove system files. And even do not remove the default files of DirectAdmin. It will crash your control panel.

For log files, you can empty them by running.

cat /dev/null > <log file name>
 

radwebhosting

Well-known member
Hosting Provider
Registered
Joined
Jan 14, 2016
Messages
272
Points
28
For Linux servers, you should view and remove old log files to prevent wasted storage:

Login to console, and the enter following commands:
Code:
# cd /var/log
# ls
Example output:

Code:
anaconda.ifcfg.log    boot.log-20111225  cron-20131110.gz        maillog-20111218      messages-20131103.gz  secure-20131027.gz   spooler-20131117.gz  up2date-20131117.gz
anaconda.log          btmp               cron-20131117.gz        maillog-20111225      messages-20131110.gz  secure-20131103.gz   squid                uptrack.log
anaconda.program.log  btmp-20120101      cups                    maillog-20120101      messages-20131117.gz  secure-20131110.gz   swinstall.d          uptrack.log.1
anaconda.storage.log  btmp-20131101.gz   dkms_autoinstaller      maillog-20131027.gz   mysqld.log            secure-20131117.gz   tallylog             uptrack.log.2
anaconda.syslog       collectl           dmesg                   maillog-20131103.gz   ntpstats              setroubleshoot       UcliEvt.log          varnish
anaconda.yum.log      ConsoleKit         dmesg.old               maillog-20131110.gz   prelink               spooler              up2date              wtmp
arcconfig.xml         cron               dracut.log              maillog-20131117.gz   rhsm                  spooler-20111211     up2date-20111211     yum.log
atop                  cron-20111211      dracut.log-20120101     messages              sa                    spooler-20111218     up2date-20111218     yum.log-20120101
audit                 cron-20111218      dracut.log-20130101.gz  messages-20111211     secure                spooler-20111225     up2date-20111225     yum.log-20130101.gz
boot.log              cron-20111225      httpd                   messages-20111218     secure-20111211       spooler-20120101     up2date-20120101
boot.log-20111204     cron-20120101      lastlog                 messages-20111225     secure-20111218       spooler-20131027.gz  up2date-20131027.gz
boot.log-20111211     cron-20131027.gz   maillog                 messages-20120101     secure-20111225       spooler-20131103.gz  up2date-20131103.gz
boot.log-20111218     cron-20131103.gz   maillog-20111211        messages-20131027.gz  secure-20120101       spooler-20131110.gz  up2date-20131110.gz
Delete any aged or unnecessary log files.
 
Latest Threads
Similar Threads
Replies
2
Views
253
Replies
8
Views
385
Replies
8
Views
842

Sponsors

Latest Blog ArticlesMost Viewed Threads

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top