Skip to content

Instantly share code, notes, and snippets.

@guyoun
Created December 1, 2015 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guyoun/47c98593699ca02ea0f4 to your computer and use it in GitHub Desktop.
Save guyoun/47c98593699ca02ea0f4 to your computer and use it in GitHub Desktop.
This script is to recover filenames changed by Synology. It appended "DiskStation_-XXX-XX-XXXX-XXXX_Conflict" to filenames.
find . -name '*_DiskStation_*_Conflict*' | while read line; do
echo "Processing file '$line'"
mv "$line" "$(echo "$line" | sed -r 's/_DiskStation_[a-zA-Z]{3}-[0-9]{2}-[0-9]{4}-[0-9]{4}_Conflict//')"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment