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 when i execute the bash script i can see the shell at ftp: with no further action.
Also is it possible to add a line to automaticcaly create the .htaccess file in the folder that would just containt the line “DirectoryIndex some.htm” ?
Anyone can help?