Solved

Directory surveillance or synchronization

Posted on 2004-08-18
4
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Bash Script to find & Kill Multiple Process 3 104
what is Amazon Linux AMI 6 80
Linux Search 3 68
WiFi Router device supports GPON! 3 154
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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