FTP & CRON Script

White Hat pigskin_referee at yahoo.com
Wed Oct 10 14:31:58 PDT 2007

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

Now, if I run the following command from the command
prompt, the script works fine.

echo \$ spam spam.zip | ftp -n

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

White Hat 
pigskin_referee at yahoo.com

Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.

More information about the freebsd-questions mailing list