#!/bin/bash


	DST="/home/backup/public_users"
	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 users, public_ftp  ${ENV} - ${DATESTART}"  >> ${LOG_BACKUP}/backup_users_${ENV}.log

		rsync -a /home/${ENV}/public_ftp ${DST}/
		rsync -a /home/${ENV}/users ${DST}/


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

	echo "Koniec: Backup users, public_ftp ${ENV} - ${DATEEND}" >> ${LOG_BACKUP}/backup_users_${ENV}.log
