#!/bin/bash
cd /home/icodex/Dev_Peer-reviewr/MyAssignment
current_date=$(date +"%d-%m-%Y")/$(date +"%H-%M-%S")
sudo -S mkdir -p /home/icodex/Dev_Peer-reviewr/Rollback/MyAssignment_Backup/"$current_date" < /home/icodex/deployment_Scrips/passwd
sudo -S cp -rf /home/icodex/Dev_Peer-reviewr/MyAssignment/ /home/icodex/deployment_Scrips/MyAssignment_Backup/"$current_date" < /home/icodex/deployment_Scrips/passwd
sudo -S  find . -type f -not -name 'appsettings.json' -exec rm -rf {} + < /home/icodex/deployment_Scrips/passwd
cd /home/icodex/azagent/_work/r5/a/_ReviewerOne-Dev\ MyAssignement/drop/Icodex.PeerReview.Assignment
sudo -S rsync -av --exclude='appsettings.json' --exclude='runtimes' ./ /home/icodex/Dev_Peer-reviewr/MyAssignment/ < /home/icodex/deployment_Scrips/passwd
sudo -S systemctl restart  DEV-MyAssignment.service < /home/icodex/deployment_Scrips/passwd

