Created
November 1, 2023 06:23
-
-
Save Isa3v/cb335c35e34eaf111eaaa0a0bc1a840f to your computer and use it in GitHub Desktop.
Bitrix: Скачивание и распаковка бэкапа
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Запрос ссылки на backup у пользователя | |
read -p "Введите ссылку на backup: " backup_link | |
# Скачивание файлов по ссылке, пока они существуют | |
counter=1 # Счетчик для итерации по файлам | |
wget -N "${backup_link}" | |
while : | |
do | |
wget -N "${backup_link}.${counter}" || break | |
((counter++)) | |
done | |
# Распаковка архива | |
tar_files=$(basename "$backup_link") | |
cat "${tar_files}"* > tmp_backup.tar.gz | |
tar -xzvf tmp_backup.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment