scp Command

Solution For Your Network Issues.

scp Command

Postby linuxczar » Mon Feb 02, 2015 1:01 pm

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
linuxczar
 
Posts: 0
Joined: Mon Feb 02, 2015 9:56 am

Re: scp Command

Postby Vipin » Tue Feb 03, 2015 12:08 pm

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.
Vipin
 
Posts: 0
Joined: Tue Nov 25, 2014 11:50 am
Location: Trivandrum


Return to Linux Networking

Login  •  Register

cron