LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Automatic updating of file on a different machine (server) when user saves a file (https://www.linuxquestions.org/questions/linux-software-2/automatic-updating-of-file-on-a-different-machine-server-when-user-saves-a-file-792290/)

resetreset 03-01-2010 03:05 AM

Automatic updating of file on a different machine (server) when user saves a file
 
Hi,
I just came back from a meeting with someone wo wants this functionality:

When he saves a file on *his* machine, it will automatically get copied onto a server (this is on an office LAN). This is so if there's a virus attack on his machine, he will have an uninfected backup copy.
To make matters worse, the client machines will be WINDOZE. Apparently he's seen this kind of functionality at an office somewhere (he was saying something about "Microsoft" , but my brain has erased that part of the conversation :) ), and now wants it for himself.


I was thinking about Samba obviously, but the tricky part is doing the copying when the user *saves* a file. This will require hooks into the OS to see when a file is being saved.

*If* I manage to persuade him to switch his client machines to Linux (which would be the ideal choice and make life far easier), how would it be done? I'd have to use the File Alteration MOnitor in the kernel, right?
Would it be possible to write the copying code in a shell script?

paranoidx 03-01-2010 04:09 AM

Quote:

he was saying something about "Microsoft" , but my brain has erased that part of the conversatio
Firstly i think as a nix user you don't have to be closed minded. Microsoft, as much as it has it flaws but so does any OS.

Quote:

When he saves a file on *his* machine, it will automatically get copied onto a server (this is on an office LAN)
Most companies inclusive of small business should have a backup/disaster/contingency recovery plan, if not, that would be the first thing you should be looking into. Most company deploys a incremental daily backup and a full backup every week depending on how critical the data is.

Quote:

This is so if there's a virus attack on his machine, he will have an uninfected backup copy.
if any OS get infected, then all the files depending on the characteristics of the virus would also be infected. So having multiple copies of the infected files be it samba or any filesystem would simply be a waste of resource. Preventative measure would have to be implemented to minimize the risk, i.e. anti virus/malware etc. On compromise, again depending on the characteristic of the virus/malware then a full system scan inclusive of the backups to provide an extensive damage assessment and resolution. If the integrity of the files cannot be ascertained, then theres no point in keeping the infected files other than salvaging as much as possible from a safe OS such as any livecd. By having a samba server to store the backups will simply store the infected file as well unless you implement some sort of real-time scanning using clamav within the nix server and trusting clamav signature db will be most updated (btw no av will provide you with 100% assurance no matter what company).

If you must save 2 copies presuming 1 local, 1 samba. There are quite a number of backup solutions, http://www.linuxquestions.org/questi...e-year-780674/ and look into real-time backup solutions. A quick implementation would be rsync (windows bin) and use windows scheduler, so no need for samba. No need to 'hook' anything which most heuristic av might pick it up as a malware.

EricTRA 03-01-2010 05:02 AM

Hello,

Another application you could use is Unison, a file synchroniser which works on various operating systems, is freeware and very easy to configure. Just have a look at it here.

Kind regards,

Eric

resetreset 03-01-2010 08:57 AM

I think I found what I was looking for here:
http://inotify-tools.sourceforge.net/

Check out the: "inotifywait example 1" in bold.

Now what I have to do is figure out how to get it to activate when *any* file is written to a particular directory - can anyone offer any help?

Sorry I think that was *in* the example.

jefro 03-01-2010 03:57 PM

I would use ZFS that allows almost unlimited previous versions.

resetreset 03-02-2010 12:22 PM

I don't follow you - unlimited previous versions of what?

devnull10 03-02-2010 12:32 PM

Just run backups of your filestore overnight. That's what most corporate companies do. If you get a virus then it's going to infect the copy too - plus, if you have write access to the network drive, it's quite possible the virus will hunt that location out (many just do a search for all available locations) and do it's dirty work there too!
I can't see any advantage of doing this "on the fly" over a scheduled backup overnight.


All times are GMT -5. The time now is 01:18 AM.