Public feed #600025

Mine

public text v1 · immutable
Raw Edit
·published 2007-07-02 16:12 UTC
rendered paste body
Login to our office stats server (10.1.1.11), all stats archived by profile, year, month and day should be located in
/backup/switch_and_data/ directory.

To access directory simply type 'cd /backup/switch_and_data', locate desired profile by typing 'ls -lash | grep PROFILENAME'.

Step by step loading of data for a specific profile (example: mackcali)

1. Look under /backup/switch_and_data/ and locate desired profile's data, in this case it's mackcali-new.
2. Navigate inside the directory all the way down to specific month you would like to retrieve data from,
   structure will look like this YYYY -> MM -> archives of each day of the month. 
3. In this example we want to recover data from 06/29/2007, so we will navigate to /backup/switch_and_data/mackcali-new/2007/06/ and locate
   our log file for 29th (access_log.DD.gz -> access_log.29.gz).
4. Now we need to locate same profile under Urchin data directory, look for mackcali under /urchin/webstats, in our example our profile
   (Mackcali) is in directory named mackcali, we will have to extract and copy stats from 6/10/2007 archive to /urchin/webstats/mackcali/access_log
5. We will now need to empty access_log file to remove any left overs from previous log and copy over data to it from the day we want to restore before
   we process it again, to do this simply execute `echo "" > /urchin/webstats/mackcali/access_log && zcat /backup/switch_and_data/mackcali-new/2007/06/access_log.29.gz >> /urchin/webstats/mackcali/access_log`.
   
   First part of this command will empty our urchin log (access_log under mackcali profile) and second part will buffer the access log from 2007/06/29 to the urchin log

6. After we verify that log is ready for processing simply execute `/urchin/bin/urchin -p mackcali` to process day of statistics we just loaded.  

So, the commands are:

ls -lash /backup/switch_and_data | grep PROFILENAME
cd /backup/switch_and_data/PROFILENAME/YYYY/MM/
ls access_log_DD.gz
  <verify the file exists>
echo "" > /urchin/webstats/mackcali/access_log 
zcat /backup/switch_and_data/PROFILENAME/YYYY/MM/access_log.DD.gz >> /urchin/webstats/PROFILENAME/access_log

Something like that