Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What I want is to be able to display all files that are ftp'd into /home/ftp in /srv/ftp

/srv/ftp is password protected, and has files in it which I don't want to be accessible from the public ftp.

So as such I wish that all files uploaded to /home/ftp are automatically symbolically linked (or otherwise) to /srv/ftp. Does this make sense?

e.g. ls /srv/ftp:

file.sh
another.txt
something_else.i386

then a user ftp's and drops a file in /home/ftp (or ssh, or whatever)

ls /home/ftp:

user_file.mk

ls /srv/ftp:

file.sh
another.txt
something_else.i386
user_file.mk

I hope this makes sense. I have been told that this can probably be achieved using ln to create symbolic links, but I don't want to have to ssh in and create the links every time I (or someone else) puts files over ftp.

Thanks! :)

share|improve this question
    
I think you are looking at a script of some kind, and, IMO I would run rsync from cron. help.ubuntu.com/community/rsync –  bodhi.zazen Mar 19 '12 at 17:56

1 Answer 1

up vote 1 down vote accepted

Adding the following line at the end of your crontab would achieve what you want:

*/1 * * * * ln -s /home/ftp/* /srv/ftp

To edit your crontab:

crontab -e

With this, /home/ftp/ will be scanned every minute and the appropriate symlinks made in /srv/ftp/.

Crontab is the command-line equivalent of Scheduled Tasks.
For details about its syntax, check out this page.

share|improve this answer
    
cool, thanks for that! :) –  Thomas Clayson Mar 20 '12 at 16:07
    
Glad to help :) –  SirCharlo Mar 20 '12 at 16:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.