I'm using ubuntu 16.04 with nginx installed, currently i run daily backup using cron like this:
#crontab -u root -e
0 2 * * * mysqldump -u username -p"password" production | gzip -c > production.gz
this will backup my database everydate at 2am, the problem here is i need to backup database based on day name, so the backup database name will be suited based on dayname, for example the file name will look like this:
production_monday.gz
production_tuesday.gz
production_wednesday.gz
production_thursday.gz
production_friday.gz
production_saturday.gz
production_sunday.gz
how can i set the cron to produce the file like above ? cron schedule will auto rewrite the file based on the day name