Many of you have belittled the victim here instead of answering the question. The victim has identified the system as being cloud based. Instead of assuming he deleted without a backup, why not assume there is a backup, and he needs to recover the directory from the backup? That's what you (the belittlers) would do if you had to undelete, isn't it?
If your system is hosted on a system that provides your ISP, they will do backups on a regular basis. You need to ask them the right question for them to understand and respond properly, but you should be able to RECOVER or RESTORE a directory from their backup. Some data might be lost, depending on the time of the last backup.
The answer here depends upon how the system is backed up, and how often. Cron and Tar is often used by small systems, and, because of its simplicity, many large systems use it too. There are other tools available, however.
If this is NOT a one man system, the likelihood is there is an IT department and a backup method in place. The IT department can help you, and you should go to them rather than trying to restore the folder/directory yourself.
If this is a home system and you ARE the IT department, and backups are strictly local, you may do backups with CRON and TAR.
Check your CRON setup to see where you put your TAR files.
Look in the tar file to get the exact path and name:
tar -tvf <backup name>.tar
Untar it.
tar -xvf <backup name>.tar <directory name>
Do a man tar for more info, or, of course, another google for tar and backup info.
Future considerations include other backup options, and a trash can type deletion instead of a real delete. A trash can type deletion involves making an alias for rm that moves items to a directory named "trash", rather than really deleting. You then empty it either with Cron or manually when you feel like it, or start getting low on space.
rm -R
... – jlliagre Sep 18 '13 at 20:40ARCHIVE_FILE=$(mktemp /tmp/XXXXXXXX.zip); rm $ARCHIVE_FILE; zip -rmT9 $ARCHIVE_FILE ${FILES_TO_DELETE}
I have a couple of days to restore from the tmp directory before tmpwatch deletes them. After that, I must restore from the normal backup system. – emory Sep 19 '13 at 00:40