Help - Search - Members - Calendar
Full Version: Don't Scp Soft Links
Linuxhelp > Support > Technical Support
nifflerX
Hi,

Really simple question that I cannot find the answer to in the man pages or online. Is there a way to scp everything in a folder except soft links? The command I use now is:

scp ./* <remote_machine>

but if there is a soft link in the current directory then I end up with everything that was in the soft link copied to the remote machine. Thanks so much.

-NifflerX
Hemant
I am thinking...I saw this post today only...
Hemant
Yeah..the solution could be something like this
A shell script
CODE
#!/bin/bash
for x in `ls`
do
  if [ ! -L $x ]
  then
     scp -r $x "to_wherever"
  fi
done


this should work with some modification on your part.
nifflerX
Thanks, this gives me a great start.

-NifflerX

p.s. Sorry it took so long to get back to you on this.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.