Community discussions

MikroTik App
 
rooneybuk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Fri Feb 20, 2015 12:09 pm

Emailing System Backup invalid BODY

Wed Dec 15, 2021 8:47 pm

ive tried a few script to email myself a system backup and the rsc file sends fine but the bin files errors with invalid BODY

here is one of the script i have tried
#
# Created Jotne 2020 v1.0
#
# Takes two different backup and send then to email
#
# backup.rsc readable backup
# Certificates, the Dude and Usermanager are also NOT exported or backed up fully and should be backed up separately.  Can be used to restore config to different routers
#
# backup.bin binary backup
# Binary backup that can only be used to fully restored the same router.
#

:local email "xyz@gmail.com"

/export file=backup
:delay 2s
/system backup save name=bin
:delay 2s
:local date [/system clock get date]
:local time [/system clock get time]
:local info [/system identity get name]
:local serial [/system routerboard get serial-number]

:local files "backup.rsc,bin.backup"
/tool e-mail send to="$email" subject="Mikrotik: Backup $info $serial" file=$files body="Automatic Backup of $info $serial at $date $time."
:delay 20s
/file remove backup.rsc
/file remove backup.bin
:log info message="Backup router=$info serial=$serial ok"
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Emailing System Backup invalid BODY

Wed Dec 15, 2021 8:57 pm

Works for me. What exactly is this error and where it comes from?
 
rooneybuk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Fri Feb 20, 2015 12:09 pm

Re: Emailing System Backup invalid BODY

Wed Dec 15, 2021 9:13 pm

Works for me. What exactly is this error and where it comes from?
Thanks for your reply, I just realized one thing i hadn't tried, I was using an IIS SMTP Server which is the one I was getting the error from so I tried relaying through a Linux SMTP relay I have and it worked
 
sheprev89
just joined
Posts: 1
Joined: Thu Jul 02, 2020 8:42 pm

Re: Emailing System Backup invalid BODY

Wed Nov 23, 2022 1:28 am

i am getting the same error what could be the problem?

the script is working on selective routers

Who is online

Users browsing this forum: dozer46 and 38 guests