Log Files

Sarama

New member
Joined
Jul 12, 2005
Messages
3
Each day I am seeing the log files grow and was wondering how these can be managed before they get out of control. The log files has the UID and GID as "root" and will not allow me to save locally or delete them. Is there a setting that I am missing to only save 5 days rather than everyday? Any suggestions or recommendations would be greatly appreciated.

Thanks,

Sarama
 
I assume you only have user level access? If so, you'll need to contact your hosting provider to clear them out and/or setup a cronjob that will remove logs that are > 5 days of age.
 
Thanks!

I am new to the unix world. My impression of a cronjob was to schedule backups rather than deleting files. Is this not accurate? Do you know how I would go about creating cronjob to remove logs that are >5 days?

Thanks and have a great day.

S
 
Sarama said:
Thanks!

I am new to the unix world. My impression of a cronjob was to schedule backups rather than deleting files. Is this not accurate? Do you know how I would go about creating cronjob to remove logs that are >5 days?

Thanks and have a great day.

S

When you don't have "root" access, you have to ask your hostingprovider to run the cronjob.
 
No, Cronjobs are to schedule automated tasks to be run and can be used to run virtually anything at a regular specified time.

Do you have root access to the server?
And you are reffering to the logs stored in your /home/username/domains/logs directory, right?

If so, one method would be to write a shell script which in a sense, scan that directory (as root) and delete logs older than 5 days (in a nutshell). Then you just have cron execute this script after the tally has been run every night.
 
Most likely I do not have root access since I did not have access to my php.ini file. However, I will double check with my hosting provider.

Also, yes I am referring to my your /home/username/domains/logs directory

As for the cronjobs, it appears that I can schedule the jobs. Whether they run will be a different story so I will also double check with my hosting provider ;)

Are shell scripts hard to write? My background is in MicroSoft, networking, KVM, POS, html, and SAP.
 
Shell scripts are not hard to write (per-say), basically it's just a file containing the instructions that you would have issued normaly through ssh.

If you don't have access to the php.ini file then you don't have root access. Even though you can create cronjobs, those scripts will be run as you so you'll still have the same problem of being unable to delete them.

The only way is to contact your hosting provider and get them to setup the script for you (or end up doing it by hand themselves).

This issue has been brought up in the forums before (charging users for logs when they can't delete them) but nothing ever came of it. Might be time to give that flame some lighter fluid.
 
Back
Top