Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying log files out to back up server

Status
Not open for further replies.

chieftan

MIS
Dec 18, 2002
292
GB
Hi, this is probably an easy question to answer, but would like how to write the script for this as I am not a scripted and have not used cron tab or anything before...

Got a CentOS server, has the log files under /var/log/radius and not only need to copy these to a local directory on the server, like /etc/var/log/radius-logs or whatever name we make, we also need to be able to have these log files automatically copied to centralised server (not the same box).

Can someone please help with the script how to achieve this


Thanks
 
cp /etc/var/log/radius/* full/path/to/new/location/for/files/

enter 'man cp' or 'cp --help' for more info

between servers, use scp (Secure CoPy) the command syntax is basically the same as the CoPy command, again use 'man scp' to get all the options.






Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
My suggestion is using nfs and mount it and using rsync to backup log files rather than using cp command..
 
Ah yes nfs. Wasted errrm spent many an hour trying to get it to work 100% reliably

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thank you for the help guys.
Yes, I figured out the cp command and tested and it worked fine........ I had a feeling that the system would need to be mounted, but I have since found out that the organisation complete a snapshot every night anyway, so a local back up is fine.

Thank you for the help. Very much appreciated.
 
rsync does not need nfs to work , it will quite happily copy over ssh (& is operfect to the task for copying to a remote server)

man rsync

A Maintenance contract is essential, not a Luxury.
Do things on the cheap & it will cost you dear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top