From owner-freebsd-questions@FreeBSD.ORG Sat Nov 9 12:31:11 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E2957641 for ; Sat, 9 Nov 2013 12:31:11 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D7DC2B45 for ; Sat, 9 Nov 2013 12:31:11 +0000 (UTC) Received: from [192.168.1.35] (host86-150-246-69.range86-150.btcentralplus.com [86.150.246.69]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id rA9CRjeq053767 (version=TLSv1/SSLv3 cipher=DHE-DSS-CAMELLIA256-SHA bits=256 verify=NO) for ; Sat, 9 Nov 2013 12:27:46 GMT (envelope-from frank2@fjl.co.uk) Message-ID: <527E2A42.4080903@fjl.co.uk> Date: Sat, 09 Nov 2013 12:27:46 +0000 From: Frank Leonhardt User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Deleting files after download References: <20131109103750.1545c9ae.freebsd@edvax.de> In-Reply-To: <20131109103750.1545c9ae.freebsd@edvax.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2013 12:31:12 -0000 On 09/11/2013 09:37, Polytropon wrote: > I'm searching for a solution for the following scenario and I hope > there's something already existing that I could use. Maybe someone > has had a comparable requirement and can share ideas? > > For transfering files that do not pass e-mail entry quota, a system > for file exchange has been installed. It's an "in-house solution", > but should be usable via Internet as well (security!). > > When Alice wants to send a file to Bob, she'd run a command to > upload the file, like this: > > $ uploadfor bob catmagazine.ps > > The "uploadfor" script would notify Bob about a new file waiting > for him (via e-mail): > > Bob, > there is a new file for you to download: > ftp://ftp.example.com/xchg/catmagazine.ps > > He can now go ahead and download the file. The choice here is a > CLI program because it's helpful to automate tasks (upload more > than one file, scripted uploads, etc.). > > After the file has been downloaded, it isn't required to be on the > server any more time. I'm searching for a solution that can do this > either > > a) right _after_ the download has been completed > (I know how to check this in ftpd -ll logs, but I don't want to > really use FTP; also both Alice and Bob have an account and will > use scp, but how can I check for successful scp transfers?) > > b) at a preprogrammed time > (A cron job, run once an hour or every day at midnight could do > that.) > > The side effect of a working solution a) would be that a message > could be sent to Alice: > > Alice, > Bob has downloaded xchg/catmagazine.ps at . > The file has been deleted. > > I din't really want to use FTP for this (even though it would be > trivial to implement). Using scp (or any other "FTP via SSH" client) > would be more secure and therefore better. :-) > > It would also be nice to have the "messaging facility" on the same > system that holds the files for exchange. In the above example, > the "uploadfor" program would generate the "invitation", while some > other program would generate the "success report". It would be cool > to have the exchange server "listening" for arrival of new files > (for whom, by whom, name, size) and generate the "invitation" from > that data. > > Any ideas? Does this maybe already exist? > For what it's worth, in a similar situation I opted for an email notification that said "This file will be available for 14 days". Apart from being somewhat easier to implement, it had the advantage that the file could be downloaded by the same person on two or more hosts, more than one recipient to the original email, and it was possible to forward the link to other people who might also want the file. I used http/s for getting the files up and down as it was just easier for the users (especially cross-platform). If you've not done this before, HTTP POST and PHP are your friends. If you use PHP for upload, you can make it do anything you like on download too. PHP remains, of course, the work of Beelzebub and the fact that it's useful at times like this is simply proof of its nefariousness. Regards, Frank.