scp Command

I need a scp command that will connect remote server and find current date & last three days log files and bring them to local machine..Remote server is AIX and local machine is RHEL 6.3.

I write below but its not working

scp / @IP:/logs/ '{find . -mtime -2 -name "*.LOG"}'

Please use code tags as required by forum rules!

You can't run commands when using scp . You have to connect via e.g. ssh to run above find command to produce a list of files, and then scp that list, or, if we're talking of few and small files, scp -p all of them and delete the unwanted ones locally.

How can i do that using SSH and SCP..Could you please help?

You can ssh to the far end and feed the determined list of files to transfer to cpio remote to stdout to cpio local. This is very similar to what scp -r does, but you can add filters to the file list. You can even add in your favorite compression:

ssh -n someone@somewhere 'find ... | cpio -oaH crc | bzip2' | bunzip2 | cpio -idmH crc

How can scp listed log files?

scp can copy; that's it. It runs as ssh under the covers.