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.


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

| improve this answer | |

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

| 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy