Cron Job to Backup Log File
How to ensure that your log data is not lost due to deleting of logs for performance reasons by system operators.
The safest place for al data is on your own pc which you must of course back up to external media (e.g. by cutting CDs) regularly.
For convenience, so that you don't need to download the logs for your site every day, it's possible to make a copy to the root directory of your site every 6 hours. Sometimes the system operators will delete alllogs and by making this copy you will lose at the most 6 hours of data.
To make the copy you simply add a cron job using cpanel.
Cron job maintenance is on the lefthand side under Advanced section tab.
Select standard interface and chose the frequency that the job will be run by selecting one item in each of the five lists
Usually you will want:
Every Month
Every Weekday
Every Day
Minute: 1
Then select either every 6 hours or a specific time for once per day or a differrent frequency.
The only technical part is the command to run which looks like:
wget -r -nd http://**user**:**password**@**domain**.com:2082/getaccesslog/
you must change the strings
**user** - user that you use to login to cpanel
**password** - corresponding password
**domain**.com - as your domain
Make sure that seperators : and @ are included.
-r tells the wget command to search the directory and get all files.
-nd tells the wget command to copy files to your root directory and create a new version (i.e. NOT overwrite the old version) each time the job is run.
If your log file is specified in a different format, the command must be changed. To see the format of the log file for your site right click the raw log file link that you use to download the file (CPanel section Stats) and use Copy Shortcut from the IE context menu to get the URL of the log file in the clipboard.
Remove the part after the final / (it usually contains the date) and the part of the URL following http:// is what should appear after the @ in the wget command.
Finally this job will result in a extra copy of your log in your root directory every 6 hours.
A description of other options available for wget is here.
More Software from 1KeyTools.com
More Software from 1KeyTools.com
| Kyb IE Offline Browsing List Maker Grab pages and make them available offline. Read easily with a shortcut key to turn to the next page on your list. | Kyboma HTML Tutorial by Example A unique HTML and script tutor for learning by example. | Kyboma Find Files N Show Kyboma Find n Show will find an article or file and display the info you are searching for quickly and easily. |
| Download Offline Browser add-on | Download HTML Tutor | Download Find Files |
Contact
Site Map
Privacy Policy
Selected Questions
Does KybIE work as a web accelerator?
Will this web tool save me money?
One Page Analysis Summary Shows Search Engine Promotion Results?
Which keywords are best for your targets when you submit your site to a search engine?
OK. Enough Web Log Analysis? Fly away for a break. Find Paris flights now. [Plane spotters call it CDG]
