woensdag 9 september 2009

ftp backup script

Hi

i've created a ftp backup script a while ago, thought i should start posting stuff here again... seems like a good thingto start with


this scrip will take all the files from the remote site and dump them in a local dir (/home/wouter/temp in this case)


you'll need to remove the space between << and EOF in the first actual line of the script (code tags are not working to well on blogger apperantly)


#!/bin/bash

remote=ftp-site-to-backup
username=your-username
passwd=Password
localdir=/home/wouter/temp
remotedir=/home/wouter/

ftp -ipn << EOF
open $remote
user $username $passwd
lcd $localdir
cd $remotedir
binary
mget gale*
bye
EOF


please take into account that this means the data goes over clear-text and is visible to annyone on the network.



thank you joren from http://www.0110.be for the assistence

Geen opmerkingen: