stoute's picture

Hallo,

Today I started useing: turnkey-fileserver-11.3-lucid-x86-vmdk

I was wondering if it is possible to get some kind of upload script for users how upload files to the ftp and log out, And then have the files moved to a different location.

 

I'm intending to uses this for my customers who only get acces to there own folder and when they log out move to a differnt location so my outher server can prossece these files.

Forum: 
Jeremy Davis's picture

Cron scripts are like 'Scheduled taks' in Windows. So you would write a script to do what you want. Then add the script to your cron jobs and make it run every minute or 2. You may need to tweak it a bit to get it to work exactly as you want.

So for the script itself, perhaps get it to check for new files/folders in a certain location and copy the files to another location if they exist. Or maybe check for logged in users and wait until they log out and then do the copy? I'm not sure how you'd do that but I'm sure it's possible. Have a bit of a google around and you should be able to piece something together (or find somewhere suitable to ask about specifics).

If you get this working nicely be great if you could post back with your solution because others may wish to do something similar.

stoute's picture

I just installed pure-ftpd on the server config was very simple only need to configure upload-script in software any one have experians with this?


Jeremy Davis's picture

No I have no idea about Pure-FTPd at all (never even heard of it until now), but that's great that you found a nice solution to your desired usage scenario. And thanks for sharing, others may also find this useful too.

A couple of things I'll note though.

  • If you installed Pure-FTPd from the standard Ubuntu repos (ie using 'apt-get install') you will have version 1.0.24 (see here). As this is in the 'universe' repo (and not main) it will not receive automatic security updates (the universe repo is community maintained, not by Canonical). Depending on whether there are security (or other serious) bugs in this version, you may wish to uninstall the repo version and install a newer version (you'll need to check the Pure-FTPd changelog to be certain of this - a quick glance suggests to me that it's probably best to update). There may also be desirable features in newer releases that aren't included in the repo version. This may not be such an issue if you only plan to use it over a LAN/VPN (ie server not available from the open internet).
    • Perhaps the easiest way to do this would be to use the packages from Ubuntu 12.04/Precise. It seems that they are v1.0.35 (the latest version). It looks like the dependancies from pure-ftpd and pure-ftpd-common would be satisfied by TKL v11.x (although you may need to install them manually, but probably not if you don't 'autoremove' them - they would've been installed when you installed the current version of pure-ftpd). They can be downloaded here and here respectively and installed using the dpkg command like this: 'dpkg -i package-name.deb'. You'll need to install pure-ftpd-common first (as it's a dependancy of pure-ftpd). Any issues please post back and I'll try to help.
  • If you weren't already aware, there are also some other bits to Pure-FTPd that looks cool, such as usage logging (to MySQL) and a LDAP connector (so you can use existing LDAP user accounts for authentication). Have a look here. (If you follow above instructions then download the relevant 12.04/Precise debs and install manually (as above).
  • From my understanding by default Pure-FTPd uses unsecured connections. This is highly undesirable and a huge security risk if your FTP server is accessable from the internet. I would definately enable TLS/SSL (and a brief look suggests that this is relatively easy).

So good luck with it and it'd be great to hear how you get on.

Add new comment