how to configure automatic copy of apache logs to html folder

We have I do have Virtual Lynix server with an ISP provider using CentOS6.0-64 Minimal for VSI.and running Apache 7. I am looking for the way to copy apache log files from

/usr/local/apache/logs to a another folder above public_html for admin to review on  hourly basic without ssh to the box.
I don’t have much experience with Linux so I am looking for detailed instructions. Something like a cron job.
leop1212Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan CraciunIT ConsultantCommented:
rsync -rtv /usr/local/apache/logs/ /home/yourusername/public_html/logs/

Open in new window

Replace "/home/yourusername/public_html/logs/" with the path to the folder where you want the logs to be copied (it must exist).

Test the command on console first, then, when you're satisfied that it does what you want, add it to the root or apache cron and you're set.

HTH,
Dan
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leop1212Author Commented:
i've tested rsync and it works.
could you provide me with crontab -e syntax if i want to copy it say every 3 hours
0
Dan CraciunIT ConsultantCommented:
5 */3 * * * /usr/bin/rsync -rtv /usr/local/apache/logs/ /home/yourusername/public_html/logs/ >/dev/null 2>&1

Open in new window

This will run the rsync at 5 minutes past every 3rd hour.

Note that you might want to log the output of rsync, for debugging purposes:
5 */3 * * * /usr/bin/rsync -rtv /usr/local/apache/logs/ /home/yourusername/public_html/logs/ >>/path/to/log.file

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.