Lost entire dietpi home folder midway while logged in

I was logged in and installed the Lighthttpd on Dietpi and was scheduling a cron job, and for no reason was not able to change directory to /home/dietpi. Upon reboot, seeing that there is no dietpi user folder with /home.

I capture the ssh session, and verified there was no deletion or anything that would have corrupted or removed the files.

I am still able to login however there are no folder for dietpi nor my files. I do have a backup i created 2 months back, but seem to have lost all of the recent scripts I had done for automation.

Any idea what would have happened and is there a way to recover the folder?

Version: DietPi v7.9.3
RPi Model: Raspberry Pi 3

Any help is appreciated!!

There is nothing on DietPi scripts that would remove dietpi user home directory. As the user is still an important one used for a couple of software title.

How to recover? There you need to use your backup and copy back the particular folder.

can you please suggest how i could recreate the dietpi folder so that i get back all the history and make it as home folder for dietpi login?

copying is not bringing back the customization i had earlier

there are just the information on the backup available. There is nothing like a recycle bin where you could restore files from. Not sure what customization you are looking for. Or did you deleted the user as well? Is it still present in cat /etc/passwd?

i never deleted anything, I am still logged in as “dietpi” but the home folder is completely missing.

the user is still in the /etc/passwd

had some customization using the color formatting of ssh session, alias shortcuts, extended history information for commands, some automation scripts for backup, applications , and more

Unfortunately these settings are gone if not backed up.

So if you are very very very sure none of your automation scripts or yourself or anything else you did could lead to the deletion of the home folder, I would consider your system as compromised!