title: Bash script to monitor new created directories
body: <p>Anyone to give pointers or ideas.</p>
  
  <p>I have a server, that is running rsync and backs up other servers to itself  on different folders creating new folders by date everyday e.g(2017-03-20).
  i want to create a bash script that will check if these backups have run, by checking the created folders and then if all backups were successfully the script will confirm by writing a text file in another folder /Z, the text file with format 20-17-03-20. If any of the backups fail the script should just exit and not create the file.</p>
  
  <p>The whole point is, i will then do a nagios plugin script to be checking this text file daily and sending results to Nagios daily.</p>
  
  <p>Any ideas will be most welcome.</p>