Hey all, I made a backup script and it will save the file but instead of the file being named 01\_files.tar.gz or 01\_databases.tar.gz all I get is a .tar.gz and then the rest of the script cannot work properly.

Here is how I set the numbers I needs in my filename:

```
# Date Variables
DAY_OF_YEAR=$(date '+%j')
DAY_OF_MONTH=$(date '+%d')
DAY_OF_WEEK_RAW=$(date '+%w')
DAY_OF_WEEK=$((DAY_OF_WEEK_RAW + 1))
MONTH=$(date '+%m')
YEAR=$(date '+%Y')

```

Here is where I am making my folders:

```
# Make Weekly Folder
mkdir tmp/weekly
echo 'Made weekly folder...'

# Make Folder For Current Year
mkdir tmp/$YEAR
echo 'Made folder for current year...'

# Make Folder For Current Month
mkdir tmp/$YEAR/$MONTH
echo 'Made folder for current month...'

# Make Biannual Folder For Current Year
mkdir tmp/$YEAR/biannual
echo 'Made biannual folder for current year...'

# Make The Weekly Backup
tar -zcvf tmp/weekly/$DAY_OF_WEEK_files.tar.gz $SOURCE
mysqldump -Av -u $DATABASE_USER -p$DATABASE_PASSWORD > $DAY_OF_WEEK.sql
tar -zcvf tmp/weekly/$DAY_OF_WEEK_databases.tar.gz $SOURCE
rm -rf $DAY_OF_WEEK.sql
echo 'Made weekly backup...'

```

However like I said I am ending up with .tar.gz instead of a proper name like 01\_files.tar.gz and 01\_databases.tar.gz so the folders are not being properly placed in the correct folders and the rest of the script doesn't work. Am I doing a data type wrong?

Thanks