[svlug] Rsync across SSH & alternatives
James Sparenberg
james at linuxrebel.org
Thu May 13 13:18:13 PDT 2010
On 05/13/2010 12:35 PM, Skip Evans wrote:
> Oh, of course. I use sshfs all the time for connecting to client
> servers I'm coding on.
>
> I think that would work well, but my real concern is going to be how
> to monitor the connection and re-establish it should it drop out.
>
> Any ideas there?
>
> Skip
>
> James Sparenberg wrote:
>>
>> Have you looked at using sshfs?
>> http://fuse.sourceforge.net/sshfs.html This is a Fuse file system.
>> Fully encrypted, and works like NFS without the stale file handles.
>>
>> I've used it In similar situations where an HA system had an app
>> that could come in from any of several servers, but needed to be able
>> to continue to access the data as if it was always the same server.
>>
>> It can be mounted and controlled by fstab, and a simple bash
>> script can be setup to check every minute for a specific dot file, if
>> it can't find it, then it remounts the mount.
>>
>> One of the things I liked about SSHFS is that it carries with it
>> the robust nature of an ssh connection, where line glyphs and packet
>> loss don't cause it to disconnect in a bad way.
>>
>> James
>>
>> ____________________________________________
>> ___
>> svlug mailing list
>> svlug at lists.svlug.org
>> http://lists.svlug.org/lists/listinfo/svlug
>>
>
what I had done was that I created a .file, then since the original box
had this on an ext3/4 file system I did chattr +i on that .file. Now
even root cannot accidentally remove the file.
Next I wrote a simple bash script something like this.
#!/bin/bash
if [ -f /route/to/my/.file ]; then
sleep 60
else
mount -o remount /route/to/my/.file # syntax requires an
fstab entry
mail -s "I recreated the mount" me at myaddy.com <.
fi
I then ran that script as a daemon and anytime it had to remount it did.
More information about the svlug
mailing list