Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tHE pURGE
- Input:
- - a <directory>
- - a list of <protected-files>
- - a list of <stored-files>
- Code a script that fetches the list of files in <directory> and:
- 1. if it's listed in <protected-files>, ignore it
- 2. if it's not listed in <stored-files>, add it
- 3. if it's listed in <stored-files>, delete it from <directory> and from <stored-files>
- Features:
- - must keep files up to date
- - must handle names with spaces and special characters
- - must reliably run multiple times (e.g. cron)
- - must handle inconsistencies (e.g. file listed in <stored-files> but not in <directory>, file listed in both <protected-files> and <stored-files>, malformed input)
- Allowed storage: plain text files or mysql
- Allowed languages: bash with basic linux commands, awk, perl or python.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement