this is my current work around: truncate before copy into ecryptfs folder:
#!/bin/bash # # Bash Script to truncate file names #
ROOT="/path/to/your/files/with/long/names" SIZE=110
find "$ROOT" -type f | \ while read filepath1; do path=$(dirname "$filepath1") file1=$(basename "$filepath1") name1=${file1%.*} extn=${file1##*.} if [ ${#name1} -gt $SIZE ] ; then name2=$(echo $name1 | cut -c1-$SIZE) file2="${name2}.${extn}" filepath2="$path/$file2" echo "1 :: $filepath1" echo "2 :: $filepath2" mv "$filepath1" "$filepath2" else # echo $name1 : fi done
this is my current work around: truncate before copy into ecryptfs folder:
#!/bin/bash
#
# Bash Script to truncate file names
#
ROOT="/ path/to/ your/files/ with/long/ names"
SIZE=110
find "$ROOT" -type f | \ "${name2} .${extn} " "$path/ $file2"
while read filepath1; do
path=$(dirname "$filepath1")
file1=$(basename "$filepath1")
name1=${file1%.*}
extn=${file1##*.}
if [ ${#name1} -gt $SIZE ] ; then
name2=$(echo $name1 | cut -c1-$SIZE)
file2=
filepath2=
echo "1 :: $filepath1"
echo "2 :: $filepath2"
mv "$filepath1" "$filepath2"
else
# echo $name1
:
fi
done