[wellylug] ftp script

William Hamilton william.hamilton at gmail.com
Fri Nov 14 15:03:48 NZDT 2008


Some basic stuff here..

Having trouble with a bash script to download a backup file from a remote
server.  Plan is to grab a backup file which is created each night and bring
it down to another box.  Grabs the file created yesterday by defining
filename based on today's date minus one day.

Below is the base of the script and I a just getting error local: file does
not exist.  Not even attempted the log and email alert part yet what am I
missing?  Feel very silly :)

tia
W


<script>
***** Some bits removed here. password user host definitions.  shebang line
is in place thought :)

FILE=$(date +%Y%m%d --date='1 days ago')
REMOTEDIR=backups/

ftp -in <<**
open $HOST
user $USER $PASSWD
lcd /home/webfund/backups
bin
mget $REMOTEDIR/$FILE*
bye
**
echo ftp script done*
</script>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20081114/b27599f0/attachment.html 


More information about the wellylug mailing list