#!/bin/bash


	DST="/home/backup/files"
	LOG_BACKUP="/var/log/backup_edokumenty"
	ENV="edokumenty"

	DATESTART=$(date +"%Y-%m-%d %H:%M:%S")

	mkdir -p ${LOG_BACKUP}
	
	if [ -d $DST ] 
	then
		sleep 1
		else
			mkdir $DST
			fi

	echo "Start: Backup files  ${ENV} - ${DATESTART}"  >> ${LOG_BACKUP}/backup_files_${ENV}.log

		rsync -a /home/${ENV}/files/ ${DST}

	DATEEND=$(date +"%Y-%m-%d %H:%M:%S")

	echo "Koniec: Backup files ${ENV} - ${DATEEND}" >> ${LOG_BACKUP}/backup_files_${ENV}.log
