Create a directory named as the current date

I am preparing a shell script to backup a few config files on a daily basis, with a retention of 30 days. Need some help with syntax/examples:

The shell script (running as cron) would require the following:

  1. create a sub-directory within a specified (backup) directory, in the format MMDDYYYY
  2. copy the config files (can be various paths) to this newly created directory
  3. delete directory which is more than 30 days old.

Thanks,
Neil

Could you show us what you tried so far and where you are stuck?
Tip: Pay attention to scripts run from cron !

I have the basic syntax which will work. I just need help with the 3 steps.

#!/bin/bash
# 1. create a sub-directory within a specified (backup) directory, in the format MMDDYYYY
DIR=$(date +%m%d%y)
# 2. copy the config files (can be various paths) to this newly created directory
for F in $FILES # here you need to specify which files...
do
cp $F $DIR
done
# 3. delete directory which is more than 30 days old.
# if you have GNU date
rm -r $(date -d "30 days ago" +%m%d%y)
# else you'll have to do some specific date calculation