#!/bin/bash
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
#date=$(date +%d-%m-%Y_%H-%M-%S)
#mbg="moscow-battle.ru_"
#tar -cjpf /user/backup_srv/sites/$mbg"$date".tar.bz2 --exclude-from=/user/backup_srv/filters/filter-list_sites.txt --absolute-names /var/www/moscow-battle.ru
filter="/user/backup_srv/filters/filter-list_sites.txt"
date=$(date +%d-%m-%Y_%H-%M-%S)
sites="/var/www"
mvsource="/user/backup_srv/sites/sites_$date.tar.bz2"
mvdest="gdrive:/backup_sites/$date.tar.bz2"
tar -cjpf /user/backup_srv/sites/sites_"$date".tar.bz2 --exclude $sites/demo.moscow-battle.ru --exclude $sites/fastdl.moscow-battle.ru --exclude-from=$filter --absolute-names $sites
rclone moveto "$mvsource" "$mvdest"
#find moscow-battle.ru -type f -size -50M -print0 | tar -cjpf /user/back up_srv/sites/$mbg.tar.bz2 --null -T -
tar -cvpzf $TMPDIR/$DATEYM/$ELEMENT-$DATE.tar.gz --directory $SITEDIR/$ELEMENT/$WEB --ignore-failed-read --exclude='./bitrix/tmp' --exclude='./bitrix/updates' --exclude='./bitrix/backup/*\.gz*' --exclude='./bitrix/backup/*\.tar*' --exclude='./bitrix/cache' --exclude='./bitrix/managed_cache' --exclude='./bitrix/stack_cache' --exclude='./upload/resize_cache' --exclude='./stats' . >> /dev/nool 2> /var/log/backup_error.log
-C, --directory=DIR
Change to DIR before performing any operations. This option is order-sensitive,
i.e. it affects all options that follow.