Paulo Matos - 2012-04-03

Hi,

Thank you for this great script.
I've not read thoroughly the code, but found 2 things that may be corrected, if you agree:

du -hsH
This issues a warning, as the option H " will soon change to be the same as that of -dereference-args"
Will just

du -hs

be enough?

rm files with 400 permisions
You suggest in your README file to create a script (runmysqlbackup) that will change the permissions of all files within the backup folder, having them changed to 400 (

find /var/backup/db* -type f -exec chmod 400 {} \;

).
In some environments can the script stop because it needs a confirmation whenever it tries to delete read only files?
I'm not sure, but to be more safe I've changed the following lines, forcing the remove (changed rm to rm -f):

find "${CONFIG_backup_dir}/${subfolder}${subsubfolder}" -mtime +"${rotation}" -type f -exec rm -f {} \;
find "${CONFIG_backup_dir}/fullschema" -mtime +"${CONFIG_rotation_monthly}" -type f -name 'fullschema_monthly*' -exec rm -f {} \;
find "${CONFIG_backup_dir}/fullschema" -mtime +"${CONFIG_rotation_weekly}" -type f -name 'fullschema_weekly*' -exec rm -f {} \;
find "${CONFIG_backup_dir}/fullschema" -mtime +"${CONFIG_rotation_daily}" -type f -name 'fullschema_daily*' -exec rm -f {} \;
find "${CONFIG_backup_dir}/status" -mtime +"${CONFIG_rotation_monthly}" -type f -name 'status_monthly*' -exec rm -f {} \;
find "${CONFIG_backup_dir}/status" -mtime +"${CONFIG_rotation_weekly}" -type f -name 'status_weekly*' -exec rm -f {} \;
find "${CONFIG_backup_dir}/status" -mtime +"${CONFIG_rotation_daily}" -type f -name 'status_daily*' -exec rm -f {} \;

Best regards,
Paulo Matos