Page 1 of 1

script to process photorec data

Posted: 16 Jan 2013, 12:56
by kikker
Hi, since I didn't see it before, here's a small script to move photorec output files into correct dirs.
Similar to what it is, but simpler IMO.
Save it to "" it to the folder with your recup[..] dirs, make it executable "chmod +x" and launch as "./".

- If you don't have dash (most gnu/linux distros do) change dash for bash, it will do the same but slightly slower.
- If you want to copy instead of move, change 'mv ' for 'cp'

Code: Select all


if [ -e $target ]; then echo "$target exists. exit."; exit; fi
mkdir $target 
for d in recup_dir.*/*; do
  mkdir -p $target/$ext
  mv -nv $f $target/$ext/

echo "done. the following files could not moved (check permissions or double file names):"
ls recup_dir.*/*