Answer the question
In order to leave comments, you need to log in
The condition for bash is if there is a “name” folder on the Yandex disk, then do not create a dad. How?
I make a backup of sites through a bash script and through it I throw backups on a Yandex disk. But before that, I need to create a folder with a specific name on the Yandex disk (via the same bash script), and if such a folder already exists, then there is nothing not to create.
I implemented this with two lines:
The first line - creates a folder with the name that I specified
The second line - throws my backup into this folder
curl -X MKCOL --user login:password https://webdav.yandex.ru/backup_sites/name_folder/
curl --user login:password -T /home/2/d008/htdocs/backup/project https://webdav.yandex.ru/backup_sites/name_folder
Answer the question
In order to leave comments, you need to log in
Why make it so difficult.
Once with your hands, make folders, let the script fill in what you need.
https://serveradmin.ru/bekap-sayta-wordpress-na-ya...
https://serveradmin.ru/backup-linux-servera-s-pomo...
test ! -d /var/backup/mysql/last && { mkdir -p /var/backup/mysql/last ; }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question