Community discussions

MikroTik App
 
HotBlock
just joined
Topic Author
Posts: 18
Joined: Sun Apr 16, 2017 12:30 pm

My Backup to Mail script dont work anymore with ROS7

Thu Oct 29, 2020 10:34 am

Hello Community,
my B2M Script dont work anymore. The mailing is alright, but i do not have any issues lines in the Log and the counte goes every day +1 up, but no email is send to me.

I think my script for ROS6.x isnt compatible with ROS7.
 
User avatar
eworm
Forum Veteran
Forum Veteran
Posts: 738
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: My Backup to Mail script dont work anymore with ROS7

Thu Oct 29, 2020 4:36 pm

Recently lost my crystal ball...
What does your script look like?
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
HotBlock
just joined
Topic Author
Posts: 18
Joined: Sun Apr 16, 2017 12:30 pm

Re: My Backup to Mail script dont work anymore with ROS7

Thu Oct 29, 2020 6:43 pm

# Mikrotik Backup Script, getestet mit 6.46+
# Version: 20.05.2020
 
# Logeintrag erstellen
:log warning "backup2email: Gestartet ..."

# Variablen setzen
:local configbackup CONFIG_backup.rsc
:local systembackup SYSTEM_backup.backup
:local backupfiles
:set backupfiles "CONFIG_backup.rsc,SYSTEM_backup.backup"
:local identity ([/system identity get name])
:local rosver ([/system resource get version])
:local time ([/system clock get time])
:local date ([/system clock get date])
:local adminemail me@protonmail.com
 
# SMTP Serverkonfig
:local mailuser sh@domain.com
:local mailfrom sh@site.domain.net
:local mailpass secret
:local mailport 587
:local mailserver
:set mailserver [:resolve "smtp.gmail.com"];
 
# Logeintrag erstellen
:log warning "backup2email: Backup anlegen ..."

# Backups erstellen
/system backup save name=$systembackup dont-encrypt=yes
/export file=$configbackup

# Logeintrag erstellen
:log warning "backup2email: Warte 3 Sekunden..."
:delay 3s

:log warning "backup2email: Sende Backup per Mail..."
 
# Die Backup-Dateien per email senden 
/tool e-mail send to=$adminemail subject="$date $time $identity Backup" body="$identity, RouterOS $rosver - $backupfiles" file=$backupfiles start-tls=yes

# Logeintrag erstellen
:log warning "backup2email: Warte 3 Sekunden bis Zustellung abgeschlossen ..."
:delay 3s
 
# Die erstellten Backup-Dateien wieder löschen
/file remove $configbackup
/file remove $systembackup
 
# Logeintrag erstellen
:log warning "backup2email: Erfolgreich!"

# END
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8507
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: My Backup to Mail script dont work anymore with ROS7  [SOLVED]

Fri Oct 30, 2020 12:44 am

/tool e-mail send to=$adminemail subject="$date $time $identity Backup" body="$identity, RouterOS $rosver - $backupfiles" file=$backupfiles start-tls=yes
Looks like you need to replace "start-tls=yes" with something like "tls=starttls"
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
HotBlock
just joined
Topic Author
Posts: 18
Joined: Sun Apr 16, 2017 12:30 pm

Re: My Backup to Mail script dont work anymore with ROS7

Fri Oct 30, 2020 9:31 am

Thank you. Thats right. The script runs again an do log his actions.

Who is online

Users browsing this forum: anschluss and 6 guests