Auto transfer FTP

I’ll start by apologizing for my ignorance. I have an install of OpenSUSE (11.4) and I’m running vsftp. We have several companies already running scripts on their end to pull all the files out of a mounted Windows share, then delete the contents of that folder. What I’m needing to do is after the files are dropped on a mounted Windows share, I need to somehow connect to an FTP server at another location, send all the files from that Windows share, and delete all the contents from that share. And on top of that, I would like to have this happen everytime a file is placed in the folder or at regular 2 hour intervals or something like that. Can someone point me in the right direction to learn how to do this. I’m fairly familiar with OpenSUSE but this is beyond my knowledge, for now. Thanks in advance.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Since you’re on a real OS like Linux you can do this pretty easily with
a script (activated via cron or whatever) and the ‘ftp’ command which is
pretty good on Linux. A simple script may be the following:

#!/bin/bash
for i in find /path/to/mount; do
ftp -a -u ftp://your.server.here/path/goes/here/ $i
done

Good luck.


Want to yell at me in person?
Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOaq7aAAoJEF+XTK08PnB5uLIP/36peWyy2mbBTzuW+0mHhY2H
AMVeIbw57LEA/e0bxGHNTkje37xk22yWkhkcXr+RumQ/wP1mzB852ZTq2OF3l2ND
n4TyGVgi+vUhnetx1JMbKylvp8OwoFgxJ8jfdgQwC1sJ+H1gdzZ6xsw8g2QIRx6K
nDAmQaDCR8EEd7POF1N9LqhthqIFnmZUf4hYyZuh6FZL9gkDn/9piIfPvUlKggMT
cwrK8Ogdz7lOZGAGxBYOz2UtKkCKNdg6ODvrIsF2FAmEbcpcPcoSZgCvy+xfMlsy
bX8cIXRBBnprlhKwSYgt1dh381e3h2jkEYNPSMN15ps6tKgpEefq0m3ZLThXGL/V
vfLJA/PXFFjj/jwL/9k8HNTC3Ll3LbajL7PX5nmYgz1JIx952WKyxv38imj9Gsna
733bXHDYazzgiXESChZlbPH1hUQvp7/Kh0j8IIN/6SI/KcFLgdetNzAuVt80j8mE
F+guFqxcVy3uJQJiy0GW1U8F+qkf+oNJdlFdb4OU8uKj3jGJ092GwPOTsxUBJ+iT
a2BM79OuRPffwiSjs00xkh3J0w8L6ZiDxyyciod4b3hnUKNBqf0/MrAOHvCaqAbV
PTit2k4h9/p/9EShgRnhWGqwtmJEKWUku6GEeoAQwIyK097aTy4W/i0e2E7P/rXy
U3/J5mG5YWlNTQWC8i5T
=IQQV
-----END PGP SIGNATURE-----

Have a look at curl, it can be used from the CLI and in scripts to do FTP operations.

Hi
Then there is always perl.

I also have a package called ftplib in my misc repo
http://nbpfaus.net/~pfau/ftplib/

Then there is duplicity http://duplicity.nongnu.org/ plus duply that I
just pushed into 12.1

So many ways…


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 4 days 2:15, 3 users, load average: 0.26, 0.18, 0.15
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Wow, I appreciate all the responses. It looks like there is a lot of ways. Thanks for giving me some options. I have never wrote a script before but have always been interested. Looks like now I have a good excuse to learn. I’m definitely going to check out the other options y’all listed. Thanks again.

Just another suggestion,
I remember a long time ago most likely in the Application Forum a thread which briefly discussed the use of FAM, which can automatically monitor a location for file changes. IIRC there is a version of FAM which is already installed on most systems supporting the installed Desktop, you will likely need to install another instance for custom application use.

If you install the server(installs the Server Daemon), you should then get the MAN and help files

 zypper install fam-server
 man fam

HTH,
Tony