#66 backup_local_files backs up nothing

v3.0_testing
open
nobody
None
5
2013-10-17
2012-04-13
Chris Janton
No

/etc/automysqlbackup/myserver.conf contains this line
CONFIG_backup_local_files=( /etc/my.cnf /etc/automysqlbackup/myserver.conf /opt/local/bin/automysqlbackup )

when process runs the log file indicates

Backup local files. Doing this weekly on CONFIG_do_weekly.
No local backup files specified.
success!

Discussion

  • Chris Janton
    Chris Janton
    2012-04-14

    There is an error in the backup_local_files routine. The initial test to see if there are files to backup tests for NO files. Changing the sense of the test allows local files to actually be backed up.

    diff of the change to make backup of local files work...

    398c398
    < if ((! ${#CONFIG_backup_local_files[@]})) ; then
    ---
    > if (( ${#CONFIG_backup_local_files[@]})) ; then

     
  • Doug V
    Doug V
    2012-05-02

    FYI, I tried editing line 398 as described in previous comment but no luck, same problem: files specified are not backed up. I'm using v3.0_rc4.

     
  • john e
    john e
    2013-10-17

    There may also be a misunderstanding about the backup local files feature, which is that it's coded as a weekly operation. So, it will require the fix above, but it will also only run on the day you designate for weekly backups, which would be Thursdays in the example below:

    # Which day do you want weekly backups? (1 to 7 where 1 is Monday)
    # Set to 0 to disable weekly backups.
    CONFIG_do_weekly="4"
    

    To have it run on every time the script is evoked, additionally patch like this.

    1723c1723
    <       if [[ "${CONFIG_backup_local_files[@]}" ]] && [[ ${CONFIG_do_weekly} != 0 && ${date_dayno_of_week} = ${CONFIG_do_weekly} ]] && (shopt -s nullglob dotglob; f=("${CONFIG_backup_dir}/backup_local_files/bcf_weekly_${date_stamp}_"[0-9][0-9]"h"[0-9][0-9]"m_${date_weekno}.tar${suffix}"); ((! ${#f[@]}))); then
    ---
    >       if [[ "${CONFIG_backup_local_files[@]}" ]] && (shopt -s nullglob dotglob; f=("${CONFIG_backup_dir}/backup_local_files/bcf_weekly_${date_stamp}_"[0-9][0-9]"h"[0-9][0-9]"m_${date_weekno}.tar${suffix}"); ((! ${#f[@]}))); then
    
     
    Last edit: john e 2013-10-17
  • john e
    john e
    2013-10-17

    PS - Attached here is a version that would work for daily backups.

     
    Attachments