Solved

!sleep in ftp ?Invalid command

Posted on 2008-11-01
5
4,210 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
  • 3
5 Comments
 
LVL 22

Accepted Solution

by:
blu earned 400 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 100 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

773 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