/usr/bin/scp error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting /usr/bin/scp error
# 1  
Old 09-20-2014
/usr/bin/scp error

I have this scp script running,
Code:
/usr/bin/scp -r /cerner/mgr --exclude-from=/atg/move_exclude.dat 102.126.112.68:/cerner

but am getting an error:
HTML Code:
--exclude-from=/atg/move_exclude.dat: No such file or directory
I am wondering if the syntax is incorrect...

I also have additional questions, please.

1) why the destination directory has to be specified with the upper directory?

I assumed it has to be
Code:
/usr/bin/scp -r /cerner/mgr --exclude-from=/atg/move_exclude.dat 102.126.112.68:/cerner/mgr

, but
HTML Code:
/mgr
has to be removed from the destination directory.

2) With scp, is there a way to skip the same file with the same size if the destination directory has the file?

Please advise. Appreciate your help!
# 2  
Old 09-20-2014
What OS are you using (i.e., output from uname -a).
# 3  
Old 09-20-2014
Source is AIX 5.3, and destination is AIX 6.1
# 4  
Old 09-20-2014
Quote:
Originally Posted by Daniel Gate
I am wondering if the syntax is incorrect...
Yes, it is incorrect. I think you are confusing scp with rsync. scp does not support the exclude-from feature.

Code:
       Some of the additional features of rsync are:

       o      support  for copying links, devices, owners, groups, and permis‐
              sions

       o      exclude and exclude-from options similar to GNU tar

1. Regarding scp, I think your assumption is right, but for the first time of scp-ing only. When you scp the second time, then you need to remove the uppermost target directory, because it already exists. You should check out the following trick with rsync and the trailing slash:

Code:
       A trailing slash on the source changes this behavior to avoid  creating
       an  additional  directory level at the destination.  You can think of a
       trailing / on a source as meaning "copy the contents of this directory"
       as  opposed  to  "copy  the  directory  by name", but in both cases the
       attributes of the containing directory are transferred to the  contain‐
       ing  directory on the destination.  In other words, each of the follow‐
       ing commands copies the files in the same way, including their  setting
       of the attributes of /dest/foo:

              rsync -av /src/foo /dest
              rsync -av /src/foo/ /dest/foo

2. Not with scp, but I think it's the default behaviour of rsync.

I hope this helps.
This User Gave Thanks to junior-helper For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting error: /usr/bin/env: ruby: No such file or directory

Hi, I installed ruby using rvm with root user on Linux. Now i m trying the below command as a non root user with sudo privileges. sudo /usr/local/rvm/rubies/ruby-2.2.5/bin/gem install passenger I get the below error: I had even reset the path for both gem as well as ruby as you... (8 Replies)
Discussion started by: mohtashims
8 Replies

2. BSD

FreeBSD: /usr/bin/ld not looking in /usr/local/lib

I'm not sure if this is the default behavior for the ld command, but it does not seem to be looking in /usr/local/lib for shared libraries. I was trying to compile the latest version of Kanatest from svn. The autorgen.sh script seems to exit without too much trouble: $ ./autogen.sh checking... (2 Replies)
Discussion started by: AntumDeluge
2 Replies

3. UNIX and Linux Applications

/usr/bin/ld: cannot find -lz error

I am installing lxml module for python on redhat I have installed libxml2 already. When I run for libxslt: ./configure --prefix=libxslt_folder --with-libxml-prefix=libxml2_folder It is ok the I run : make I have error: /usr/bin/ld: cannot find -lz collect2: ld returned 1 exit status I... (4 Replies)
Discussion started by: AIX_30
4 Replies

4. Red Hat

/usr/bin/rhgb-client -- error while loading shared libraries: libpopt.so.0

Hi All, I have RHEL 5 installed in my system. Something must has happened because when i reboot the server, it came with many error.. /usr/bin/rhgb-client -- error while loading shared libraries: libpopt.so.0. Can't open shared object files. No such file/directory It finnaly ends with the... (6 Replies)
Discussion started by: IgnitedMind
6 Replies

5. OS X (Apple)

When to use /Users/m/bin instead of /usr/local/bin (& whats the diff?)?

Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself. But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Discussion started by: michellepace
1 Replies

6. Shell Programming and Scripting

!/usr/bin/ksh error

Usually we use !/usr/bin/ksh at the start of the script.But if I am having this stuff in the scripts and calling one script from other its not working.What may be the reason behind it ? xyz.ksh #!/usr/bin/ksh echo "Hi" abc.ksh #!/usr/bin/ksh echo "I am fine" ksh xyz.ksh Its... (4 Replies)
Discussion started by: dr46014
4 Replies

7. Solaris

How do I link ld in /usr/ucb/ to /usr/ccs/bin?

Hi all, below is the problem details: ora10g@CNORACLE1>which ld /usr/ucb/ld ora10g@CNORACLE1>cd /usr/ccs/bin ora10g@CNORACLE1>ln -s /usr/ucb/ld ld ln: cannot create ld: File exists ora10g@CNORACLE1> how to link it to /usr/ccs/bin? (6 Replies)
Discussion started by: SmartAntz
6 Replies

8. AIX

nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error

-------------------------------------------------------------------------------- Hello, help me please. I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? : Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies

9. UNIX for Dummies Questions & Answers

/bin/sh: /usr/bin/vi: No such file or directory when doing crontab

I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)
Discussion started by: kwalter
3 Replies
Login or Register to Ask a Question