Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 0.44 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2.  
  3. # For Drupal 7
  4. #  Generate a list of files that are present in the database,
  5. #  but not physically present in the filesystem.
  6.  
  7. if [ "$(basename $(pwd))" != "files" ]; then
  8.         echo "Change into the files/ directory of your drupal site and try again."
  9.         exit
  10. fi
  11.  
  12. for f in $(
  13.         echo "SELECT uri FROM file_managed" |
  14.         drush sql-cli |
  15.         sed -n -e 's/public:\/\/\(.*\)/\1/p'
  16. ); do
  17.         test -f $f || echo $f
  18. done