назад к заметкам

Резервное копирование на ЯндексДиск
#!/bin/sh

TAR="$(which tar)"
GZIP="$(which gzip)"
FTP="$(which ftp)"
NOW=$(date +%Y%m%d)
mkdir /tmp/backuptmp
mkdir /tmp/backuptmp/$NOW
$TAR -cf /tmp/backuptmp/$NOW/etc_astra.tar /etc/astra
$TAR -cf /tmp/backuptmp/$NOW/astra_bin.tar /usr/bin/astra
ARCHIVE=/tmp/backuptmp/server-$NOW.tar.gz
ARCHIVED=/tmp/backuptmp/$NOW
$TAR -zcvf $ARCHIVE $ARCHIVED
cd $BACKUP
DUMPFILE=server-$NOW.tar.gz
curl --user vasya@yandex.ru:password -T $DUMPFILE "https://webdav.yandex.ru/backup/"
rm -rf /tmp/backuptmp/*