Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/* /var/www/vhosts/* /var/www/vhosts/* /var/www/vhosts/*

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

migrated from Feb 19 '10 at 23:55

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

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

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

Your Answer


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