Community discussions

MikroTik App
 
Nuri
just joined
Topic Author
Posts: 15
Joined: Mon Sep 10, 2018 1:25 pm

Backup via Email Auth failed

Tue Mar 29, 2022 3:59 pm

Hi guys,

I am working for a company. Where our customers has Mikrotik Routers. What I did is a script to send backups via email. It will work for maybe 2 or 3 Devices and after that i recieved the log entry AUTH Failed. I am using a Gmail Account where I enabled unstrusted Apps. No 2FA. Is there a limit of devices and locations at Gmail?
Here is my script:

/tool e-mail
set address=smtp.gmail.com from=xxxxx password=xxxxx port=587 start-tls=yes user=xxxxx
/system script
add name=autoBackupundviamail owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":log info \"backup beginning now\"\r\
\n:global backupfile (\"mailbackup\".[/system identity get name])\r\
\n/system backup save name=\$backupfile\r\
\n:log info \"backup pausing for 10s\"\r\
\n:delay 10s\r\
\n\r\
\n:log info \"export beginning now\"\r\
\n:global exportfile (\"mailexport\".[/system identity get name])\r\
\n/export file=\$exportfile\r\
\n:log info \"export pausing for 10s\"\r\
\n:delay 10s\r\
\n\r\
\n/tool e-mail send to=\"xxxxx\" subject=([/system identity get name] . \\\r\
\n\" Backup\") from= xxxxx file=\$backupfile server=smtp.gmail.com\r\
\n:log info \"backup finished\"\r\
\n:log info \"backup being emailed\"\r\
\n\r\
\n:delay 00:00:10\r\
\n\r\
\n/tool e-mail send to=\"xxxxx\" subject=([/system identity get name] . \\\r\
\n\" Export\") from= xxxxx file=\$exportfile server=smtp.gmail.com\r\
\n:log info \"export finished\"\r\
\n:log info \"export being emailed\"\r\
\n\r\
\n:delay 00:00:30\r\
\n/file remove \$backupfile\r\
\n/file remove \$exportfile\r\
\n\r\
\n"

/system scheduler
add interval=2w1d name=schedule2 on-event="/system script run autoBackupviamail" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=oct/02/2018 start-time=07:00:00
/

Who is online

Users browsing this forum: abdulschizo, Amazon [Bot], DMITRYB, fibracapi and 85 guests