Link to home
Start Free TrialLog in
Avatar of VH
VH

asked on

linux pull logs and export FTP

I am looking for a bash script to select logs from a directory, between two dates, then off load them to a TFTP server.

I don't  want a file created with the logs on the system, just a temporary copy and then exported.
Avatar of noci
noci

FTP != TFTP and both are not secure...
Maybe scp is a better replacement.

touch -t yyyymmddhhmm.ss /tmp/starting_time
touch -t yyyymmddhhmm.ss /tmp/ending_time
find /whateve/directory -newer starting_time -older /tmp/ending_time -exec scp '{}' user@remote:/whatever/place/you/want/
rm -f /tmp/starting_time /tmp/ending_time
ASKER CERTIFIED SOLUTION
Avatar of Duncan Roe
Duncan Roe
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello. Depending on what logs exactly you want to 'backup', Linux has some built in commands that may help you.
It has been a while since I did some 'heavy lifting' with Linux but I remember something about the logrotate command.
Check out the man pages on it 'man logrotate' from the terminal and maybe you will see some options there.
There may be another built in Linux feature, but I am going to have to try and remember what it was.
Avatar of VH

ASKER

Thanks worked !