?
Solved

!sleep in ftp ?Invalid command

Posted on 2008-11-01
5
Medium Priority
?
4,552 Views
Last Modified: 2013-12-27
I have this scripts that seems to be working because I can see the files being trnsferred, but I don't know why in the /var/mail/oracle there are messages as if some commands are wrong;

The  script that is being excuted by another script with the at now <  command is int the "Cde Snippet" and the oracle cron outpu is the following.
I wonder why this messages and how to make it error free.

Your "at" job on proddb
"/var/spool/cron/atjobs/1225545781.a"

produced the following output:

?Invalid command
Local directory now /proddb/ora6/STARPROD/arc
Interactive mode off.
/usr/bin/sh: !sleep: not found




> more autoftp
 
ftp <ip address>
!sleep 60
lcd /proddb/ora6/STARPROD/arc
prompt off
cd /oradata/WHSEVZW/u03/STARPROD
!sleep 5
bin
!sleep 5
mput *.Z
!sleep 240
quit

Open in new window

0
Comment
Question by:LindaC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 22

Accepted Solution

by:
blu earned 1600 total points
ID: 22859364
Are you sure it is working? In general, you can't just put sub-commands to a command in a script and have it work. To do that, you need a redirect to tell the shell that the just of the script is supposed to be input to the FTP:

ftp <ip-addr> <<EOF
!sleep 60
lcd /proddb/ora6/STARPROD/arc
prompt off
cd /oradata/WHSEVZW/u03/STARPROD
!sleep 5
bin
!sleep 5
mput *.Z
!sleep 240
quit
EOF

ALso, any outout is mailed to the user, even if everything works okay. If you want to avoid that,
change the ftp line to:

ftp <ip-addr> > /dev/null <<EOF
0
 
LVL 8

Author Comment

by:LindaC
ID: 22859555
I changed the script and included the  <<EOF, so I will wait a while to see how it goes.
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 400 total points
ID: 22861491
If this is running as a crontab job then you need to put the full path name

!/usr/bin/sleep 60

How authentication is done?
0
 
LVL 8

Author Comment

by:LindaC
ID: 22862672
Authentication is being done by .netrc with a chmod of 600.

But I think blu has the answer as the error has not shown again:

Your "at" job on proddb
"/var/spool/cron/atjobs/1225615694.a"

produced the following output:

Local directory now /proddb/ora6/STARPROD/arc
Interactive mode off.


Waiting for any additional comments to award the points.
0
 
LVL 8

Author Closing Comment

by:LindaC
ID: 31512385
Thank you.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question