johanneslamers / backup-suite

Backup database, static files and config to AWS S3 with Cronjob

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors with bash backup-files.sh

mariovass opened this issue · comments

I seem to be getting these errors when trying to run the backup-files bash script

tar: +%Y-%m-%d_%Hh%Mm_date: Cannot stat: No such file or directory
tar: +%A-home-forge-.tar.gz: Cannot stat: No such file or directory

.env looks like this for the backup part

### Folders to backup
### An array of directories you want to backup (I included a few configuration directories to).
export DIRECTORIES=(
    'home/forge/'
    'etc/nginx/'
    'etc/mysql/'
    'etc/php/'
)

We managed to fix this issue by tweaking the syntax slightly to output the dates:

WEEK=$(date +%V) # Week number e.g 38
MONTH=$(date +%B) # Month e.g January
DATE=$(date +%Y-%m-%d_%Hh%Mm) # Date stamp e.g 2017-03-02_23h12m
DAY=$(date +%A) # Day e.g. Monday