madridista
New Member
Hi there
I am pretty new in the Linux world. I am just setting up a MySQL Database and now I want to create an automatic backup job for all the databases.
I'm using the following script to create the backup:
#!/bin/bash
DATE=$(date +%d%m%Y-%H)
mysqldump -u backupuser -p'12345' --all-databases > alldb-"$DATE".sql
sleep 5
pixz alldb-"$DATE".sql
My crontap file:
Mailto=[email protected]
30 14 * * * /mnt/disk2/backupdb.sh
The script is working fine, so the backup is created as wanted. But I want to change the location of the created file. Now the file is created in my userhome but I would like to change it to the location /mnt/disk2 or another location beside my userhome.
How can I do this? And what do I need to do that I receive the backup mails? As you can see I wrote in the crontap file MAILTO=[email protected] but I never received a mail.
Really appreciate your help!
I am pretty new in the Linux world. I am just setting up a MySQL Database and now I want to create an automatic backup job for all the databases.
I'm using the following script to create the backup:
#!/bin/bash
DATE=$(date +%d%m%Y-%H)
mysqldump -u backupuser -p'12345' --all-databases > alldb-"$DATE".sql
sleep 5
pixz alldb-"$DATE".sql
My crontap file:
Mailto=[email protected]
30 14 * * * /mnt/disk2/backupdb.sh
The script is working fine, so the backup is created as wanted. But I want to change the location of the created file. Now the file is created in my userhome but I would like to change it to the location /mnt/disk2 or another location beside my userhome.
How can I do this? And what do I need to do that I receive the backup mails? As you can see I wrote in the crontap file MAILTO=[email protected] but I never received a mail.
Really appreciate your help!