Solved

Directory surveillance or synchronization

Posted on 2004-08-18
4
201 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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