Skip to content

Commit

Permalink
Iterate inside folder backups
Browse files Browse the repository at this point in the history
Tries to fix #156 #157
  • Loading branch information
prodrigestivill committed Sep 4, 2024
1 parent 97ed2d5 commit 414fbfc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,16 @@ for DB in ${POSTGRES_DBS}; do
MFILENEW="${MFILE}-new"
rm -rf "${DFILENEW}" "${WFILENEW}" "${MFILENEW}"
mkdir "${DFILENEW}" "${WFILENEW}" "${MFILENEW}"
ln -f "${FILE}/"* "${DFILENEW}/"
ln -f "${FILE}/"* "${WFILENEW}/"
ln -f "${FILE}/"* "${MFILENEW}/"
(
# Allow to hardlink more files than max arg list length
# first CHDIR to avoid possible space problems with BACKUP_DIR
cd "${FILE}"
for F in *; do
ln -f "$F" "${DFILENEW}/"
ln -f "$F" "${WFILENEW}/"
ln -f "$F" "${MFILENEW}/"
done
)
rm -rf "${DFILE}" "${WFILE}" "${MFILE}"
echo "Replacing daily backup ${DFILE} folder this last backup..."
mv "${DFILENEW}" "${DFILE}"
Expand Down

0 comments on commit 414fbfc

Please sign in to comment.