Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Nov 2013 10:37:50 +0100
From:      Polytropon <freebsd@edvax.de>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Deleting files after download
Message-ID:  <20131109103750.1545c9ae.freebsd@edvax.de>

Next in thread | Raw E-Mail | Index | Archive | Help
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 <timestamp>.
	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, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20131109103750.1545c9ae.freebsd>