Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to transfer all of the log files off of a server and hope someone can help me. I'm pretty stuck.

The directory and file structure is like so.

/var/www/vhosts/site1.com/statistics/logs/access_log* /var/www/vhosts/site2.com/statistics/logs/access_log* /var/www/vhosts/site3.com/statistics/logs/access_log* /var/www/vhosts/site4.com/statistics/logs/access_log*

I need to tar all of the domain folders and only the files that start with access_log.

Thanks for the help.

share|improve this question
add comment

migrated from stackoverflow.com Feb 19 '10 at 23:55

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 0 down vote accepted

Is this a Plesk server, if yes be careful about using /tmp as it could be a small partition.

I use: tar -cvf /var/logs.tar /var/www/vhosts/*/statistics/logs/access_log*

You can then compress the logs with gzip, bzip2, or whatever other zip program you want to use.

gzip /var/logs.tar

share|improve this answer
    
Thanks Jeff. Worked perfect. –  user35491 Feb 20 '10 at 1:01
add comment

cd /var/www/vhosts; tar cjf /tmp/logs.tar.bz2 */*/*/access_log*

share|improve this answer
    
If this is a plesk box, those wild cards would grab other folders as well. –  jeffatrackaid Feb 20 '10 at 0:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.