Closed smaniktahla closed 1 year ago
@smaniktahla what are your settings in the ### TrueNAS config backup settings
section of your config file?
Here's what I have in the .conf file. The file does appear in /root/backup, which is what's really weird to me.
configBackup="true" # Change to "false" to skip config backup (which renders next two options meaningless); "true" to keep config backups enabled emailBackup="true" # Change to "true" to email TrueNAS config backup saveBackup="true" # Change to "false" to delete TrueNAS config backup after mail is sent; "true" to keep it in dir below backupLocation="/root/backup" # Directory in which to save TrueNAS config backups
@smaniktahla try this branch and let me know if it helps.
Sorry for the long delay in replying, but nope, same thing with the new branch:
I corrected this by editing report.sh at line 170 from:
echo -e "Content-Type: application/tar+gzip\n"
to
echo -e "Content-Type: application/tar+gzip"\n
I did the same to lines 151, 179 and 1667 as they seem to suffer from the same issue.
I do not know if this is the correct way to fix it, but it's now working for me.
@karearea83 do echo -e 'Content-Type: application/tar+gzip\n'
or echo "Content-Type: application/tar+gzip"
also work?
That line looked like this in my version of the script (which @dak180 had steered me to previously): echo -e "Content-Type: application/tar+gzip name='"'${filename}.tar.gz'"'\n"
What does the \n do?
@smaniktahla It adds a new line.
Ah okay. Well, putting the \n outside the double quotes didn't change things for me. I did try this with the lines referenced by @karearea83, but no luck. I can mangle the script so it produces worse output, too 😁 as I found out to my consternation.
@karearea83 do
echo -e 'Content-Type: application/tar+gzip\n'
orecho "Content-Type: application/tar+gzip"
also work?
The first does not, it goes back to a noname file. The second is what the original script I had has and does work.
With echo -e "Content-Type: text/html; charset=utf-8"\n I expect to output to be
"Content-Type: text/html; charset=utf-8"
And with echo -e "Content-Type: text/html; charset=utf-8\n" I expect the output to be
"Content-Type: text/html; charset=utf-8 "
I believe the former is the correct syntax.
I'm running TrueNAS-13.0-U2.
@smaniktahla or @karearea83 try this branch and let me know if it helps.
Hi @dak180
Nope, that one doesn't work. But I do get a different outcome this time.
It's now calling the file "'${filename}.tar.gz'", screen grab attached
When executing the script and emailing to personal gmail account, I get a file attachment called "noname" that appears to have the MIME payload when I edit it.
The file attachment's first two lines are: Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=20220624230508_TrueNAS-12.0-U8.1-4e9efc861d.tar.gz (and then the MIME payload)
Everything else seems fine, the email appears with all other relevant script info properly formatted, and the backup file exists in the backup location with the correct name. I don't know enough about MIME headers to know what might be the issue here, though.
Any assistance would be greatly appreciated!