#!/bin/sh
TAR="$(which tar)"
GZIP="$(which gzip)"
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 /tmp/backuptmp
DUMPFILE=server-$NOW.tar.gz
curl --user user@yandex.ru:password -T $DUMPFILE "https://webdav.yandex.ru/backup/"
rm -rf /tmp/backuptmp/*
40 2 * * * sh /opt/backup.sh > /dev/null
Комментариев нет:
Отправить комментарий