1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

How to locate /var file and delete Log file?

Discussion in 'Plesk 11.x for Linux' started by andyas, Dec 22, 2012.

  1. andyas

    andyas New Pleskian

    10
    35%
    Joined:
    Jul 20, 2012
    Messages:
    7
    Likes Received:
    0
    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
     
  2. Faris Raouf

    Faris Raouf Silver Pleskian Plesk Guru

    31
    30%
    Joined:
    Mar 15, 2009
    Messages:
    667
    Likes Received:
    17
    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.
     
  3. andyas

    andyas New Pleskian

    10
    35%
    Joined:
    Jul 20, 2012
    Messages:
    7
    Likes Received:
    0
    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
     
  4. MislavO

    MislavO Regular Pleskian

    16
    85%
    Joined:
    Jul 20, 2012
    Messages:
    271
    Likes Received:
    1
    Location:
    Croatia
    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.
     
Loading...