#61 email attachments not working

closed-fixed
nobody
None
5
2012-01-17
2012-01-13
bertys
No

using latest v3.0-rc6 setting log level to 'files' results in mail errors being sent from my server.
it looks as if it's trying to send the mail to the wrong variable. here's a snippet from the email:

"I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
</home/mysql.backups/daily/mysql/daily_mysql_2012-01-13_12h09m_Friday.sql.gz>:
Recipient unknown"

I've seen the previous bug report with what looks to be the same issue, which says it was fixed in RC1.
either it isn't fixed, i'm doing something wrong, or this is a different bug.

Thanks

Discussion

<< < 1 2 3 > >> (Page 2 of 3)
  • PittaGurneyi

    PittaGurneyi - 2012-01-13

    Ss long as you don't figure out why find doesn't run, you'll have no backup rotation ...
    what is the output of
    find -version
    ?

     
  • bertys

    bertys - 2012-01-13

    wow, stupid me! yup, addng the 'fi' made it work. I'm now receiving backups via email.
    as for the find version,

    GNU find version 4.1.20

    Backup rotation definitely used to work though, but I was on v2 then I think...

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-13

    Well this is strange ... seems find is in $PATH ... if you notice that the rotation isn't working and keep getting this /usr/bin/find ... ELF error, please leave a note.

     
  • bertys

    bertys - 2012-01-13

    will do, thanks for everything.

     
  • bertys

    bertys - 2012-01-14

    I have the script running hourly and they don't rotate every 24 hours, is that normal behaviour? I would have assumed that hourly backups should be auto deleted if they are over 24 hours old.

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-16

    Well, as I told you, the find command, which searches for the outdated files and removes them, doesn't work for you - was in the errors: /usr/bin/find: line 1: ELF: command not found
    Please give the output of
    file /usr/bin/find

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-16

    Also put
    echo "$PATH" > /choose/a/file
    type -a find > /choose/a/file2
    in the script after the end of the first comment lines (beginning with #).
    Then post the contents of the files.

     
  • bertys

    bertys - 2012-01-16

    /usr/bin/find: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped

    $PATH =
    /sbin/e-smith:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

    find is /usr/bin/find

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-16

    Looks okay. Please create a script - a file - with the following content
    #!/bin/bash
    find /usr/bin -name 'find'

    Then chmod +x scriptname
    and execute it ./scriptname
    How are you executing automysqlbackup anyway?
    Are you still getting the ELF error you posted?

     
  • bertys

    bertys - 2012-01-16

    script returns
    /usr/bin/find

    i'm executing the script via cron simply with 'bash path/to/script'

    the error still appears in the logs. it says /usr/bin/find: line 1: ELF : command not found. which line 1 is it refering to do you think?

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    The error occurs when you are trying to source a binary file.
    Well then there is absolutely no reason why automysqlbackup should not work with find. Have you tried running automysqlbackup from the command line?

     
  • bertys

    bertys - 2012-01-17

    yes, exactly the same result when ran from comand line.

    the error never used to be there when I first started using automysqlbackup. it suddenly started appearing.

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    Then please make a diff between your current automysqlbackup version and the one you freshly download.
    diff file1 file2

    Are you using a pre or postbackup script? can you please show me your cron script?

     
  • bertys

    bertys - 2012-01-17

    http://pastebin.com/A5N9Nq9x

    i made some small changes to the email subject lines and made the changes we've discussed in this thread. I don't think a lot else is different

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    The script makes a change to the PATH variable, which is used to search for programs.
    Please add
    PATH=${PATH}:/usr/local/bin:/usr/bin:/bin:/usr/local/mysql/bin
    just after #!/bin/bash (next line)
    in the script you created and try again.
    I however still don't see a pattern here or a reason why this would be happening.

     
  • bertys

    bertys - 2012-01-17

    I found the cause of the problem...it was this line I added to my conf:

    CONFIG_postbackup="find "${CONFIG_backup_dir}"/daily -type f -mmin 1440 -exec rm {} \;"

    I added it in an attempt to get hourly backups to rotate. I removed the line, the error is now gone but I still dont have rotating hourly backups.

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    That should have occured to you earlier ... well nothing we can do about that now.

    CONFIG_postbackup should have a script as a variable, because bash sources it. That means, that it just runs another bash script within the current environment - configuration and runtime variables that are also available in the automysqlbackup run. Therefore, what you did there doesn't make any sense. And now the error is obvious: Somewhere in the script it says
    source "${CONFIG_postbackup}"
    which then looked like
    source find ...
    and that is exactly the error we got by trying to source a binary file (find).

    But that is very clear in the documentation.

    So - in plain english - what do you want to do ... think about it and write it down in a way that i understand ist clearly.

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    This error however won't occur again - the next version will have a check whether CONFIG_pre and postbackup contain a file.

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    Well if you want this find command to work, you just have to put a file with the contents
    #!/usr/bin/env bash
    find "${CONFIG_backup_dir}"/daily -type f -mmin 1440 -exec rm {} +

    somewhere and then set CONFIG_postbackup="/your/path/to/file"
    That should work ...

     
  • bertys

    bertys - 2012-01-17

    yes you're right, I should've caught it earlier. I apologise for wasting your time.

    realised that line of mine wont work as there are subfolders inside the daily folder...

    What i'm trying to achive is to rotate my hourly backups. Currently my daily folder is growing as there is nothing in place to handle old files. In a perfect world I guess there'd be a separate hourly folder which contained a user-set amount of hourly backups (i'd set mine to 24 hours but others might want more hourlys saved). the daily folder would be rotated each day as usual, but you'd have the added security of hourlys.

    I expect this should be a feature request.

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    This sounds more like a case of differential backup ... That way you only keep the diff files relative to the last master backup. However since I made some critical changes to that part of the script, the next version will be incompatible to the old Manifest files. This was necessary because the old script was vulnerable to unexpected behavior when strange filenames (including path) would occur.

    Your line works just fine ... find goes into subfolders recursively ...

     
  • bertys

    bertys - 2012-01-17

    im getting this error when running that line

    find: missing argument to `-exec'

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    Perhaps find is too old ... try
    find "${CONFIG_backup_dir}"/daily -type f -mmin 1440 -exec rm {} \;

     
  • bertys

    bertys - 2012-01-17

    ok, making that change removed the error but still didn't run. After googling, I found that the 1440 should be +1440
    it now works!

    again, thanks for all your help and for your script
    I will be donating to the cause.

     
  • PittaGurneyi

    PittaGurneyi - 2012-01-17

    Very much appreciated!

    I guess I can close this bug, but will keep comment posting open.
    Have fun using the script!

     
<< < 1 2 3 > >> (Page 2 of 3)

Log in to post a comment.