Tag Info

New answers tagged

0

I may be missing something but it looks like you just need an extra mv step to rename the copied files. Something like: machine="server1.nyc.ny" logdir="/var/log/jboss" logs="garbage.log splunk.log jboss.log" targets="" for BOX in ${machine[@]};do scp $BOX:$logdir/\{"${logs[0]}","${logs[1]}","${logs[2]}"\} ./ for log in ${logs[@]}; do mv ...


4

You should make part or all of your .bashrc not run when your shell is non-interactive. (An scp is an example of a non-interactive shell invocation, unless someone has radically altered your systems.) Then put all commands that can possibly generate output in that section of the file. A standard way to do this in an init file is: # Put all the commands ...


0

with proper key settongs, assuming you can set thoses keys in myserver's app home dir. scp file.txt app@myserver:/etc/app/config/file.txt Step 1) in local host, check in $HOME/.ssh for any file name id_rsa.pub, if found goto step 3. Step 2) If not found, in local host (starting host) cd $HOME mkdir .ssh chmod go-rwx .ssh cd .ssh ssh-keygen accept ...


1

Ok, first of all the linux host MUST have the SSH service on. i.e.(ubuntu) host$ /etc/inist.d/ssh status * sshd is running Then you MUST have to have connection to the SSH port of the host mac$ telnet <IP.of.the.host> 22 Trying X.X.X.X ... Connected to X.X.X.X Escape Character is SSH-X.X-OpenSSH_X.X Then you could be able to scp FROM/TO the ...


1

I would continue to use your computer as a the local machine and put the wildcard on the remote host side by running the following command on your MAC: mac> scp me@host.some.where:remote/folder/file* local/folder If you really want to log in to your machine from the remote host here is a brief guide. The wi-fi connection you are on is likely over a ...


5

By default, scp remote paths are interpreted relative to the home directory, so you don't need the ~ at all: scp user@remote.host.com:some/file/name filename will download some/file/name from the home directory of user and save it as filename locally. When you want to use an absolute file path on the remote server, start it with /: scp host:/etc/passwd ...



Top 50 recent answers are included