"Project Requirements":
The Samba server shares the/tmp/folder, where anyone can write files, but prevents the following files from being written to:
You cannot write to the/tmp folder after you change the file name extension.
Using the shell to detect subfolders in/tmp/, the above files are immediately deleted.
"Solution ideas":
The query file name contains RAR files, but cannot be probed after renaming to Doc.
With the Linux file command, you can directly probe the file type, even if the change file name is detectable.
"Solution":
#!/bin/bashwhile:d ORM-RF $ (file $ (find/tmp/) | egrep "Archive | gzip | Tar | Windows | DOS "| Awk-f ': ' {print $} ') Sleep 1done
The script can be executed on the boot
This article is from "Knowledge change Fate technology Change Life" blog, please be sure to keep this source http://leoshi.blog.51cto.com/152597/1697574
Linux Delete Directory Compressed files