Solved

Directory surveillance or synchronization

Posted on 2004-08-18
4
196 Views
Last Modified: 2012-05-05
Hello,
I have this situation I'd like help on : during a project development we are granting someone FTP access to a subdirectory on our Linux server. However for several reasons we'd like to be aware of all activity in that workspace and also have a backup solution, so that for example if a file is uploaded and then removed we'd still be aware of that and have a copy of the file. I had in mind to use rsync and/or a tool detecting changes inside that dir, but I'm not sure how that would translate ?
Making a copy of the dir to another directory with a timestamp every minute would not be too rational even though disk space is not an issue...Could that idea be combined with a "change detection" tool (tripwire ?) triggering the backup/copy only when changes occur ?
Regards,
 
0
Comment
Question by:Denisvt
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:xscousr
ID: 11840840
pure-ftpd allows you to run a script after each file is uploaded. With this feature you could write a script which backed up or copied the files as they came up.

http://www.pureftpd.org/index.shtml

run pure-ftpd as your ftp server and the second daemon pure-uploadscript and use something like

#!/bin/bash
#
# copy uploaded file and email a notification
#
DATESTAMP=`date +%Y%m%d`
TIMESTAMP=`date +%Y%m%d_%H%M_%S`
notifymail="/tmp/notifymail"
archive="/var/archive"
log="/var/log/upload-${TIMESTAMP}.log"
upload="$1"
fname="$1"
        if [ $var1 = usertowatch ]; then
        chmod g+rwx $upload
        cp $upload $archive
        echo "File Uploaded at $TIMESTAMP" >$notifymail"
        echo " ">>$notifymail
        echo "Name                            Size" >>$notifymail"
        echo " " >>$notifymail
        ls -lh $upload | awk ' { print $9 "         " $5 }' >>$notifymail
        mail -s "New File uploaded to FTP" alert@domain.com <$notifymail
        rm $notifymail

fi

0
 
LVL 3

Author Comment

by:Denisvt
ID: 11841479
Right now the server we use runs ProFTPD, would you solution require that we install that other FTP server and/or replace our current one ?
I guess our contact has to use that server so that the script can be triggered ?

0
 
LVL 2

Accepted Solution

by:
xscousr earned 125 total points
ID: 11841789
you don't need to replace ProFTPD. Just for this project you could run pure-ftpd on a different port and have the developer use it.
 (yes it is the only ftp daemon i have found that has this ability to lauch a script upon receiving a file)
0
 
LVL 3

Author Comment

by:Denisvt
ID: 12134267
Thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now