• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to locate /var file and delete Log file?

andyas

New Pleskian
Suddenly because I had a 500 error I found out that I am out of disk usage because of the logs locate on /var and /usr files from the root; my problem is I dont know how to edit or delete the content of this files (not the file, just the content, maybe edit)

I made some space deleting old unnecessary files but I have over 38 gb stored in those files...
Would appreciate any help, but please consider I am a newbie, so step by step help will be useful...Txs
 
Log files in /var/log/ should not grow too big. There is a utility that runs every day called logrotate that basically looks after things in this respect. It prevents them getting out of hand. Or it should. And by default it normally does. There isn't anything you would normally need to do to make it work. Use google to learn more about logrotate.

The maillog, which is in /usr/local/psa/var/maillog should also be automatically prevented from getting too big. There's plesk housekeeping file that normally runs every day that takes care of this.

So I think there's something generally wrong on your system. It is possible that logrotate is not being executed for some reason. This needs to be investigated.

To edit files I use a utility called nano. It is often instaled by default. There are other editors, such as vi but these are confusing to use.

To use nano to edit a file you use:
nano /var/log/directory/whatever/file-you-want-to-edit
To exit the program you press CTRL-X and it will ask you if you want to save your changes.

To delete a file use the rm command.

e.g.: rm /var/log/directory/something/filename-you-want-to-delete

You need to be logged in as root for all this as the files usually won't be accessible to a normal user.

warning! rm is dangerous!

For more information on how a command works, search Google, or at the command line you can use the man command:
man command-you-want-to-learn-about
e.g.: man rm

I'm not sure what else to suggest. There must be many resources on the internet that will help you with system administration, and there are plenty of good books you can buy.

I hope these little hints help though.
 
Hello, txs a lot for taking time on this; all this looks a bit too advanced for me, maybe will use for other visitors, most probably I will just look for professional help, I am too afraid to do something wrong..

When I decide to go with this admin panel I expect that it will make all much easier and more friendly use , but it isn't, you need to have advanced ssh knowledge, need to make a lot of settings manually , in the end either you need to pay someone extra to maintain the server and plesk setting either to have quite advanced knowledge as said.
Txs again
 
If the file has 38GB, then using nano is absolute ridiculous, when will file open? Next year? :)))

Use in shell following command:
# cat /dev/null > <NAME_OF_THE_FILE>

This will empty the content within a file, but will not delete the file itself.

How to locate file? Simply, with a script, if you are interested i can give you my script.
 
Back
Top