From owner-freebsd-questions@FreeBSD.ORG Sat Nov 9 09:38:10 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 34ED0FCF for ; Sat, 9 Nov 2013 09:38:10 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF04B240B for ; Sat, 9 Nov 2013 09:38:09 +0000 (UTC) Received: from r56.edvax.de (port-92-195-117-74.dynamic.qsc.de [92.195.117.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 243DF3CB69 for ; Sat, 9 Nov 2013 10:38:02 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id rA99boA7002141 for ; Sat, 9 Nov 2013 10:37:50 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 9 Nov 2013 10:37:50 +0100 From: Polytropon To: FreeBSD Questions Subject: Deleting files after download Message-Id: <20131109103750.1545c9ae.freebsd@edvax.de> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2013 09:38:10 -0000 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? -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...