Advertisement
teslazap

tHE pURGE

Feb 26th, 2015
1,201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. tHE pURGE
  2.  
  3. Input:
  4. - a <directory>
  5. - a list of <protected-files>
  6. - a list of <stored-files>
  7.  
  8. Code a script that fetches the list of files in <directory> and:
  9. 1. if it's listed in <protected-files>, ignore it
  10. 2. if it's not listed in <stored-files>, add it
  11. 3. if it's listed in <stored-files>, delete it from <directory> and from <stored-files>
  12.  
  13. Features:
  14. - must keep files up to date
  15. - must handle names with spaces and special characters
  16. - must reliably run multiple times (e.g. cron)
  17. - 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)
  18.  
  19. Allowed storage: plain text files or mysql
  20.  
  21. Allowed languages: bash with basic linux commands, awk, perl or python.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement