this should take care of it for you...
(NOTE: i am using your example so change it accordingly
)
create ~/.netrc and change its permissions to rw only by you
chmod 600 ~/.netrc if it does not already exist, otherwise just add the following anywhere in the file as long as it is above any 'default' line you have
in .netrc place this line
Code:
machine 2##.1##.82.1## login mike password mike
this should allow for auto-login. you can confirm this by running 'ftp 2##.1##.82.1##' if it logs you in without prompt for user/pass then continue
example script (
script_name):
Code:
#!/bin/bash
# used to delete filename_to_delete from 2##.1##.82.1##
#
ftp << EOF
open 2##.1##.82.1##
delete filename_to_delete
bye
EOF
that should be it. make the script executable (chmod 700
script_name), then add it to cron.
confirm that it works from cli first. if it works when invoked from cli (
./script_name) but not from cron then add
. /etc/bashrc above the 'ftp << EOF' line and try again
hope this helps
[EDIT: i would agree with trickykid on using ssh if possible]