Skip to content

Commit e792e0a

Browse files
authored
faster chmod if there are many objects to process
Initializing datadir on big DB-s took too long
1 parent f02df77 commit e792e0a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

runtime/functions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ create_datadir() {
2828
echo "Initializing datadir..."
2929
mkdir -p ${PG_HOME}
3030
if [[ -d ${PG_DATADIR} ]]; then
31-
find ${PG_DATADIR} -type f -exec chmod 0600 {} \;
32-
find ${PG_DATADIR} -type d -exec chmod 0700 {} \;
31+
chmod 0600 $( find ${PG_DATADIR} -type f )
32+
chmod 0700 $( find ${PG_DATADIR} -type d )
3333
fi
3434
chown -R ${PG_USER}:${PG_USER} ${PG_HOME}
3535
}

0 commit comments

Comments
 (0)