Page 1 of 1

scp Command

PostPosted: Mon Feb 02, 2015 1:01 pm
by linuxczar
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..Is it possible??

I write below but its not working

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

Re: scp Command

PostPosted: Tue Feb 03, 2015 12:08 pm
by Vipin
Hello,

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.