1

I am using mysqldump command to take backup of my database.

mysqldump --add-drop-table -u user -ppassword databasename > backup/mybackup_$(date +%d%m%Y_%H%M).sql

and it works fine...But i want to automate this so that it can take a backup once in every two days or something..for this i am using crontab..

15 2 * * * mysqldump --add-drop-table -u user -ppassword databasename > backup/mybackup_$(date +%d%m%Y_%H%M).sql

but this is giving me an error in putty saying command not found..any idea why?? Please help me..

1 Answers1

5

Use the complete path to mysqldump, e.g. /usr/bin/mysqldump.

As suggested by the comments, it's a very good idea to use an absolute path for the destination file as well.

Robert Munteanu
  • 1,542
  • 5
  • 22
  • 38