Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Oct 2007 16:45:39 -0500
From:      Derek Ragona <derek@computinginnovations.com>
To:        White Hat <pigskin_referee@yahoo.com>, FreeBSD Users Questions <freebsd-questions@freebsd.org>
Subject:   Re: FTP & CRON Script
Message-ID:  <6.0.0.22.2.20071010164447.0253f6f0@mail.computinginnovations.com>
In-Reply-To: <201915.39444.qm@web34405.mail.mud.yahoo.com>
References:  <201915.39444.qm@web34405.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 04:31 PM 10/10/2007, White Hat wrote:
>This is driving me crazy. I have a small script that I
>run from CRON. It is run as a regular user and not as
>ROOT, although I have tried it both ways. It uploads
>SPAM to the 'knujon.com' site'.
>
>I have created a ~/.netrc file that looks like this:
>
>machine knujon.com
>         login user
>         password secret
>
>
>macdef  spam
>         put $1
>         quit
>
>
>
>Now, if I run the following command from the command
>prompt, the script works fine.
>
>echo \$ spam spam.zip | ftp -n
>ftp://user:secret@knujon.com
>
>The above should all be on one line, although it may
>be shown split into two right now.
>
>However, if this is put into a bash script, and run if
>from CRON, I receive a mail with this error message:
>
>'spam' macro not found.
>
>I have no idea what I am doing wrong.
>
>I have the $HOME, $SHELL and $PATH variables set in
>CRON.

try set -x and see what the output looks like.  I'd guess you are not 
escaping the $ right in your script.

         -Derek

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20071010164447.0253f6f0>