fix: selfhost back to tar.gz (#4500)

* fix: selfhost back to tar.gz

* fix
This commit is contained in:
Manish Gupta 2024-05-17 15:24:21 +05:30 committed by GitHub
parent 90b50a4162
commit f7ccf01426
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -287,7 +287,17 @@ function backupSingleVolume() {
backupFolder=$1 backupFolder=$1
selectedVolume=$2 selectedVolume=$2
# Backup data from Docker volume to the backup folder # Backup data from Docker volume to the backup folder
docker run --rm -v "$selectedVolume":/source -v "$backupFolder":/backup busybox sh -c 'cp -r /source/* /backup/' # docker run --rm -v "$selectedVolume":/source -v "$backupFolder":/backup busybox sh -c 'cp -r /source/* /backup/'
local tobereplaced="plane-app_"
local replacewith=""
local svcName="${selectedVolume//$tobereplaced/$replacewith}"
docker run --rm \
-e TAR_NAME="$svcName" \
-v "$selectedVolume":/"$svcName" \
-v "$backupFolder":/backup \
busybox sh -c 'tar -czf "/backup/${TAR_NAME}.tar.gz" /${TAR_NAME}'
} }
function backupData() { function backupData() {
@ -303,11 +313,8 @@ function backupData() {
fi fi
for vol in $volumes; do for vol in $volumes; do
# selected_volume=$(echo "$volumes" | sed -n "${volume_number}p")
local backup_folder="$BACKUP_FOLDER/$vol"
mkdir -p "$backup_folder"
echo "Backing Up $vol" echo "Backing Up $vol"
backupSingleVolume "$backup_folder" "$vol" backupSingleVolume "$BACKUP_FOLDER" "$vol"
done done
echo "" echo ""
@ -371,7 +378,6 @@ function askForAction() {
elif [ "$ACTION" == "7" ] || [ "$DEFAULT_ACTION" == "backup" ] elif [ "$ACTION" == "7" ] || [ "$DEFAULT_ACTION" == "backup" ]
then then
backupData backupData
askForAction
elif [ "$ACTION" == "8" ] elif [ "$ACTION" == "8" ]
then then
exit 0 exit 0