Re: bash_logout and sftp
From: Kevin Sullivan (ksulliva_at_psc.edu)
Date: 05/06/05
- Previous message: David Ho: "Re: Disconnecting: Corrupted MAC on input."
- In reply to: Corey: "bash_logout and sftp"
- Next in thread: Derek Martin: "Re: bash_logout and sftp"
- Reply: Derek Martin: "Re: bash_logout and sftp"
- Reply: Corey: "Re: bash_logout and sftp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 05 May 2005 21:34:24 -0400 To: Corey <corey_s@qwest.net>, secureshell@securityfocus.com
--On 5/1/05 2:56 AM -0700 Corey wrote:
> ( What I'm trying to get working is to execute user-specific rsync jobs
> for mirroring purposes whenever a user finishes uploading files using
> sftp - it seemed that a .logout sort of rc script would be the easiest
> method of doing this; the only other option I can think of is to use a
> log analyzer to grep for 'session closed for user' msgs )
How disciplined are your users? Have them create/transfer a dummy
"/tmp/alldone" file as the last thing they do. A periodic cron job can
check for it and if it exists, delete it and run rsync.
Or in sshd_config, replace the sftp line with:
Subsystem sftp /usr/libexec/sftp-server-rsync
And create /usr/libexec/sftp-server-rsync containing:
#! /bin/sh
/usr/libexec/sftp-server "$@"
touch /tmp/alldone >/dev/null 2>&1
Modify as needed depending on where your OS puts sftp-server. You could
have this script run the rsync directly but you'd probably get overlapping
rsync runs and other issues; best not to try.
-Kevin
- application/pgp-signature attachment: stored
- Previous message: David Ho: "Re: Disconnecting: Corrupted MAC on input."
- In reply to: Corey: "bash_logout and sftp"
- Next in thread: Derek Martin: "Re: bash_logout and sftp"
- Reply: Derek Martin: "Re: bash_logout and sftp"
- Reply: Corey: "Re: bash_logout and sftp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]