patch for very long file names
This commit is contained in:
parent
bb7349a0ad
commit
b3d5ff40f4
@ -130,7 +130,18 @@ generate_split_metadata()
|
|||||||
SCHEMA="postgres"
|
SCHEMA="postgres"
|
||||||
fi
|
fi
|
||||||
OUTPUTDIR="${BACKUPDIR}/${DBNAME}/${SCHEMA// /_}/${TYPE// /_}"
|
OUTPUTDIR="${BACKUPDIR}/${DBNAME}/${SCHEMA// /_}/${TYPE// /_}"
|
||||||
OUTPUTFILE="${OBJECT}.sql"
|
# PATCH for very long file names
|
||||||
|
OUTPUTFILE="${OBJECT::240}"
|
||||||
|
OUTPUTFILE="${OUTPUTFILE// /_}"
|
||||||
|
if [[ -f ${OUTPUTDIR}/${OUTPUTFILE}.sql ]] ; then
|
||||||
|
for ((x=1; x<1000 ;x++)) ; do
|
||||||
|
if [[ ! -f ${OUTPUTDIR}/${OUTPUTFILE}_${x}.sql ]] ; then
|
||||||
|
OUTPUTFILE="${OUTPUTFILE}_${x}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
OUTPUTFILE="${OUTPUTFILE}.sql"
|
||||||
|
|
||||||
mkdir -p "${OUTPUTDIR}"
|
mkdir -p "${OUTPUTDIR}"
|
||||||
echo -e "${OUTPUTDIR}/${OUTPUTFILE}"
|
echo -e "${OUTPUTDIR}/${OUTPUTFILE}"
|
||||||
echo -e "${LINE}" > "${OUTPUTDIR}/${OUTPUTFILE}"
|
echo -e "${LINE}" > "${OUTPUTDIR}/${OUTPUTFILE}"
|
||||||
|
Loading…
Reference in New Issue
Block a user