Not Good: My own FTP script

Date April 18, 2008

My backup FTP script is NOT GOOD.. it exhausted my memory ?? on the webserver caushing the server to ‘crash’ / not react for 4 hours, even connecting my monitor to the server: I could type my username, but login: nope ..

So message to self: how the hell can I FTP 40GB of data via a shell script without exhausting my memory .. <sigh> …

rebooting (fingers always crossed) and after 5 minutes the server was up again

My Simple FTP script

Date March 26, 2008

#!/bin/bash
cd /home/backup/server
if [ -e data ]
then
cd /home/backup/server/data/
HOST=’ftp-server-address’
USER=’username’
PASSWD=’password’
ncftp -u $USER -p $PASSWD $HOST << EOT
binary
cd /Volume_1
mkdir `date “+%d-%m-%y”`
cd `date “+%d-%m-%y”`
mput *
bye
EOT
fi
cd /home/backup/server
rm -rf data

with some help of Matthijs en of course myself and a little ‘maggi’ I created a bin/bash shell script to backup data (backup of the server) to one of my other FTP server(s)

it checks if the data folder is available and if so than the a ftp session is started, logged on, a folder with the todays date is made and the data is put in that folder. After that the data folder including the content will be removed. Yes I know there is no validation if A = B but I’ve no idea how to accomplish that, but this works in my test environment. This script is saving me about 4 Hours of datatransfer where FTP is showing me a nice 10MB/s where Samba / NFS is showing me a not satisfied performance at all .. (I believe the total amount of data is about 40GB I have to backup everytime … ) ..

hints and tips welcome to have a A=B comparison before removal of the data folder ;-)

Proftpd adding features to setup

Date September 22, 2006

I got a special request of a user:

allow a user to upload files, see the files but do not allow them to download any of the stored files. (So you can share 1 account to many but they are not allowed to download those files with that same account).

The master user of that vhost is allowed to control the whole upload folder.

It took me a good dinner to find an appropriate proftpd.conf setting. Some tests performed and it’s working now .

Find here the script

New Feature @ this Playground

Date August 17, 2006

I have implemented a new kewl feature today. I wanted to have ‘rotating’ images on every day of the hour for every day of the week. Through the #Wordpress IRC channel (press only if you have IRC installed) I heard about the website of Dunstan Orchard. He implemented a rotating panorama header image with xml connection to the weatherforecast.

Okay I do not want to have it that advanced, but in a similar way it must be possible I thought. And Yes it is possible .. I am still experimenting, shooting images but slowly you will see every day of the week, every hour a different image displayed here @ the playground. It can be everything: the PlayGround, Something we did at a certain time a certain date. Let it be a unique PlayGround Project ..

What do I use? It’s not that difficult to find out. But it’s working.

Do you want to advertise: yeah it’s possible !

Â