how to make the contents of a file disappear after x numbers of days or at date

Tim Henderson bizdev at pwnspeak.com
Thu Sep 9 16:52:03 UTC 2010


On 09/09/10 07:20, user1 wrote:
> Anybody know of a way to make the contents of a file (txt, html, jpeg,
> png, mp3, ogg etc.) disappear after a certain number of days.
>
> To make the whole content or a selected part of a file to disappear.
>
> The charateristic must be hidden in the file and not to be removed by a
> copy.
>
> I should be a kind of wipe operation :-)
>
>

Don't konw how to contain a "wiping" characteristic in the file itself. 
  On top of that, contain the characteristic, and not be removed.  I 
think your on to a new file type :)

I can only think of scripting the process by cron, or sleep commands.

Copy nothing to file:
cp /dev/null FILE
Copy nothing to file in 5 days:
sleep 432000 && cp /dev/null FILE &

Text files:
grep what_you_need FILE > NEWFILE; cat NEWFILE > FILE
tail -# FILE > NEWFILE; cat NEWFILE > FILE
...same goes for head

For the binary types, you're on your own if you want to remove certain 
things from the binary.  Mass removal easy, altering binary hard.

Tim H.




More information about the ubuntu-users mailing list