-
Junior Member
Cron Job to Copy Log Files
I want to setup a Cron job to copy my log files, as log files are only kept for 7 days. Can anyone help me with a unix command that might work please? I can see where to enter the Cron job in the control panel, but what command might I use?
I want to copy '/hsphere/local/home/ukpages/logs/withernsea-carnival.co.uk/*.gz' to '/hsphere/local/home/ukpages/admin.withernsea-carnival.co.uk/rawlogs/'
But if I do that each week, the file names will be the same and will overwrite the old logs. Is there a way to change the filename or add them all to a single gz file perhaps using the date at a filename?
Also, which time and day would be best to do the copy, to make sure the entire weeks log files are there waiting to be copied?
Many thanks
Colin Davis
webmaster@ukpages.org
-
DirectAdmin Fan :)
The only way to do this that I am aware of is to create a script that will rotate the log based on x days or x size and rename it. Then you would run that script via ssh.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Bookmarks