Solved

heredoc error message in a shell script for FTP

Posted on 2007-04-05
1
702 Views
Last Modified: 2013-12-16
Hello,

When I try to execute the following shell script:

#!/bin/sh
HOST='ftp.yourdomain.com'
USER='yourid'
PASSWD='yourpw'
FILE='file.txt'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
ascii
get $FILE
quit
END_SCRIPT
exit 0

I receive this error message:

./my_script_name: line 7: cannot create temp file for here document: No space left on device

Line 7 is where the here doc begins with this string: <<END_SCRIPT

I know that I have sufficient space on the server from which I am running the script. What else should I look at to get it to work? I have, of course, substituted the values for HOST, USER, PASSWD, and FILE to my actual values and if I interactively FTP from the shell, I have not problem FTP-ing and getting the file.
0
Comment
Question by:mdichirico
1 Comment
 
LVL 8

Accepted Solution

by:
frashii earned 125 total points
ID: 18862432
Do you have permission to write to /tmp ? Or is that full ?

Sometimes people set /tmp to be read only for certain things, and sometimes /tmp is set to be non-execute which would cause these kinds of problems.

Try:

mount   (to check the permissions)
ls -ald /tmp
and
df -h (to check the space)
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

SSL is a very common protocol used these days when browsing the web.  The purpose is to provide security to communication, but how does it do it?  There are several pieces at work that have to be setup before SSL will even work and it requires both …
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

809 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