Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp permissions

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have the following script
# ftps a file to the datawarehouse
# written by : George Smith
# November 2000

{
ipaddress=${1:?Missing_ipaddress}
filename=${2:?Missing_filename}
ftp -nv $ipaddress <<-EOF
user user password
cd /data_ld
put $filename
quit
EOF
}
ftp.sh: END

if I invoke it like this > ftp.sh 161.218.nnn.nn test

it works fine

if I invoke it like this

ftp.sh 161.218.nnn.nn /data05/app/pwmscripts/test

i get the following error

550 /data05/app/pwmscripts/test: Access is denied.
221

by specifying the full path I am somehow getting a security error - any ideas


 
try this:
[tt]
ipaddress=${1:?Missing_ipaddress}
filename=${2:?Missing_filename}
[red]basefilename=$(basename filename)[/red]
ftp -nv $ipaddress <<-EOF
user user password
cd /data_ld
put $filename [red]$basefilename[/red]
quit
EOF
[/tt]

I don't have a unix box here so -- mind the typos....

Mike
michael.j.lacey@ntlworld.com
 
What directory are you in when running the script & is there a test file in your pwd?
What are the permisions and what is the ownership of the file /data05/app/pwmscripts/test?


Ged Jones

Top man
 
Ged -- I think it was because he was specifying a path from the source machine that didn't exist on the target machne..
Mike
michael.j.lacey@ntlworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top