2

1] I want to create a script which matches the today's date >> with server's date format.

2] If it matches then, it will create the folder named "$date" itself in the mentioned path "/tmp/test/files/testing/".

3] Moreover, it will search for the files which are created by today's date with the help of "find" command from "/var/www/path" and take the back up with the help of the rsync command of those files into /mnt/ folder.

I'm kinda new shell scripter however, kindly help me with the script.

________________________________________________________________________________

What I've did until now is :>>>>>>>

##!/bin/bash 
now=$(date +"%m_%d_%Y")


mkdir /tmp/test/files/testing/"date +%b%Y%m%d"/$now &&


find . -type f -newermt 2019-06-10 -ls -exec rsync -avzh {} /mnt/Data/exes/10-June-2019/ \;  &&

mysqldump -h localhost -u username -ppassword production > /mnt/Data/date +%b%Y%m%d/productionDate.sql

________________________________________________________________________________

Thanks, Bakula

PerlDuck
  • 13,885
bakula
  • 21

0 Answers0