#!/bin/bash
sudo id
echo "Enter hostname"
read vm
echo "Enter date in format YYYY.MM.DD"
read dt
mkdir ${vm}_${dt}
mkdir ${vm}_${dt}/nginx
mkdir ${vm}_${dt}/opt
mkdir ${vm}_${dt}/fluent-bit
mkdir ${vm}_${dt}/rsyslog
echo "Folders created. Start copy process"
sudo cp -r /etc/nginx ${vm}_${dt}/
sudo cp -r /opt/nginx ${vm}_${dt}/opt
sudo cp -r /etc/fluent-bit ${vm}_${dt}/
sudo cp -r /etc/rsyslog.d/nginx.conf ${vm}_${dt}/rsyslog/
sudo chown -R ${USER}:${USER} ${vm}_${dt}
sudo chmod -R 744 ${vm}_${dt}
echo "Copy completed"
