Server rentals :: NFOservers.com

Forums

All times are UTC - 8 hours



Author Message
PostPosted: Wed Jul 11, 2012 10:37 pm 
Offline
New to forums
New to forums

Joined: Wed Jul 11, 2012 10:34 pm
Posts: 6
Hi there,

I'm looking to run a sort of cronjob that will automatically move logs ('adlpickupz' TFC logs, to be exact) from my server to my webspace. Is there an easy way to do this?

Ideally, I'd be able to discriminate whether someone was playing in the server (e.g. don't copy over empty logs).

Thanks


Top
 Profile  
 
PostPosted: Thu Jul 12, 2012 10:51 am 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9310
Location: Seattle
I don't know of a premade easy solution. You could just use "wget" to pull all of the files pretty easily, but anything beyond that would require some custom scripting.

(It's also important to note that you should not make your logs public, as they'll have your rcon password in them, so make sure they are in a folder that is not visible through the web.)


Top
 Profile  
 
PostPosted: Mon Jul 16, 2012 10:48 pm 
Offline
New to forums
New to forums

Joined: Wed Jul 11, 2012 10:34 pm
Posts: 6
I ended up doing the following as a cronjob (I hope this is useful to anyone else!)

Code:
#!/bin/sh
# get all logs and delete those under 65kB
wget ftp://user:pass@user.game.nfoservers.com/tfc/logs/*.log -N
find . -type f -size -65k -exec rm {} \;

# delete any lines that contain 'rcon'
grep -il rcon * | xargs -n 1 -I log sh -c 'grep -v rcon log > log'


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
It is currently Tue Jun 18, 2013 11:33 pm
Powered by phpBB® Forum Software © phpBB Group