I'm running this bash script to make a backup of the database, but I'm always getting an error on the date and tar command.
#!/bin/bash
backup_filename=/var/www/vhosts/foo.com/private/backup_foo_db.sql
filename="db_daily_"`date +%Y%m%d`".tar.gz"
compressed_filename=/var/www/vhosts/foo.com/private/backup_foo_db_$filename.tar.gz
mysqldump --add-drop-table -h localhost -ufoo -pbar foobar > $backup_filename
tar cvfz $compressed_filename $backup_filename
rm $backup_filename
./mysqlbackup.sh: line 3: date: command not found
Could this be a permission problem? I'm not running that file as root.
/usr/bin/date
,/usr/bin/tar
, etc