Protecting data on shared linux ubuntu laptop

I have share a laptop to test a custom application.  I will not have physical control of the machine and I'm uncertain what will happen to the laptop after the test.   My application is completely stored and run under a user directory.   Since, I'm not sure that I will get the laptop back after the test, is there a way to have the machine automatically purge my application after a certain time?  

For example:  All works fine for the first 24 hours, and then the app is deleted.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You don't have physical control of the laptop before the test either? If you never have physical control, you'd be forced to work within the confines of application domain (user space). So of course you could write some sort of watchdog app to remove itself after 24 hours. For more info on that option, you need to specify which language / environment you are using.
> All works fine for the first 24 hours, and then the app is deleted.
1. record the first login time
edit your ~/.profile and add
if [ -s ~/.login_time ]
   touch ~/.login_time
   date +%s > ~/.login_time

2. a shell script to check the first login time and delte the directory after 24 hours.
--- ~/bin/ ---


FIRST_LOGIN_TIME=`cat ~/.login_time`
CURRENT_TIME=`date +%s`

# check if the time spend from the first login time greater than 86400 seconds
if [ "$TIME_DIFF" -gt "86400 ]
   /bin/rm -rf  $DIR_TO_CLEAN
chmod +x

3. Set up the cron job to run the script every 5 minutes
*/5 * * * * /home/<username>/bin/ > /dev/null 2>&1

4. Make sure the crond is running at boot time....

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Woo, typo

# check if the time spend from the first login time greater than 86400 seconds
if [ "$TIME_DIFF" -gt "86400" ]     # <== this line
   /bin/rm -rf  $DIR_TO_CLEAN
use cron with :

find /path/to/files* -mtime +1 -exec rm {} \;

Put cron for specific date and time :
Control the environment, which means bring your own laptop to demonstrate the application and then you either install it on their laptop/system after they decide to purchase it and then you can demonstrate that it is functional at the time (for the second time)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.