Bash script problem


#1

Hi guys, i’m having a problem with a bash script to run on a crontab:

i can get the script to login on a ftp and download all the stuff i need to backup and publish it on my website but i can’t get the script to connect and delete the stuff that has been backed up. To explain what i was trying to do here is the lines i added:

#!/bin/bash
suffix=$(date +%y%m%d)
mkdir /home/user/domain.com/folder/$suffix
cd /home/user/domain.com/folder/$suffix
wget -nc ftp://user:pass@domain/folder/.

so until now it works fine: i run the script and all the files are backed up but i need to remove them from the souce so i added:

ftp
open domain
user
pass
cd /folder/
delete .

but the error is that from the bash script it get’s stuck at the ftp prompt. Any suggestions?