Deleting files after download

Polytropon freebsd at
Sat Nov 9 09:38:10 UTC 2013

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

The "uploadfor" script would notify Bob about a new file waiting
for him (via e-mail):

	there is a new file for you to download:

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

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

The side effect of a working solution a) would be that a message
could be sent to Alice:

	Bob has downloaded xchg/ 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?

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list