Community discussions

MikroTik App
 
zanetti
just joined
Topic Author
Posts: 15
Joined: Tue Mar 11, 2008 6:23 am

Email Backup Script worked in 3.3, doesn't in 3.4

Tue Mar 11, 2008 6:27 am

Dear Tikers,

I had a email backup script working in 3.3 that doesn't in 3.4. The script is as follows:

/system backup save name=([/system identity get name] . "-" . [:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6]); /tool e-mail send to="harbl@4chan.org" subject=([/system identity get name] . " Backup " . [/system clock get date]) file=([/system identity get name] . "-" . [:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6] . ".backup"); :delay 10; /file rem [/file find name=([/system identity get name] . "-" . [:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6] . ".backup")]; :log info ("System Backup emailed at " . [/sys cl get time] . " " . [/sys cl get date])

When I run the script from the prompt I get

Saving system configuration
Configuration backup saved
interrupted
input does not match any value of file


The script writes a file named mikrotik,-,2008,mar,10.backup which seems like the system can't find when it looks for the file to send... Any thoughts would be appreciated.

Z
 
User avatar
chvdr
Member
Member
Posts: 403
Joined: Thu Sep 22, 2005 8:53 pm

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Wed Mar 12, 2008 2:05 pm

why don't use wiki's script?
 
zanetti
just joined
Topic Author
Posts: 15
Joined: Tue Mar 11, 2008 6:23 am

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Wed Mar 12, 2008 11:14 pm

The wiki script doesn't work either in 3.4, thanks though.
 
User avatar
chvdr
Member
Member
Posts: 403
Joined: Thu Sep 22, 2005 8:53 pm

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Thu Mar 13, 2008 11:13 am

sorry, it's my fault.
tasted, working, but on 3.3; on 3.4 it have never been tesed by us.
 
savage
Forum Guru
Forum Guru
Posts: 1264
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Thu Mar 13, 2008 12:19 pm

None of my scripts from 3.3 works on 3.4... Running the script in a terminal on 3.4 works, running it via the sceduler, it doens't do anything...

I'm about to go back to 3.3
 
User avatar
chvdr
Member
Member
Posts: 403
Joined: Thu Sep 22, 2005 8:53 pm

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Thu Mar 13, 2008 2:53 pm

None of my scripts from 3.3 works on 3.4... Running the script in a terminal on 3.4 works, running it via the sceduler, it doens't do anything...

I'm about to go back to 3.3
shuld guruz say us what to do...
i upgraded 3.3 to 3.4 - no scripts works from scheduler.
under console - works fine
 
sergeda
Frequent Visitor
Frequent Visitor
Posts: 78
Joined: Wed Sep 20, 2006 6:03 am

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Sun Apr 27, 2008 10:13 am

The same happen to me in 3.7
I've got error when I try to run this script from console and it doesn't work with scheduler. But when I run it with winbox I 've recieved email backup despite that run counter says 0.
I can't find working script for backup for 3.7
 
lcrhea25
Member Candidate
Member Candidate
Posts: 115
Joined: Wed Nov 29, 2006 4:30 pm

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Tue May 06, 2008 4:58 pm

Has anybody got the back up script working in 3.4 yet? I am getting this error. Script Error: cannot compare if nothing is more than nothing
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Tue May 06, 2008 7:06 pm

3.4 has MAJOR scripting problems and cannot be used for nearly any scripts. Upgrade, I believe its stable with scripting.
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: Email Backup Script worked in 3.3, doesn't in 3.4

Tue May 06, 2008 7:22 pm

try this one (modified yours below): (Also make sure your "/tool email" has proper config.)
:local backupname ([/system identity get name] . "-" . \
    [:pick [/system clock get date] 7 11] . \
    [:pick [/system clock get date] 0 3] . \
    [:pick [/system clock get date] 4 6])
:local emailaddress "YOUREMAILADDRESS"
:local subject ("{mtbackup} " . [/system identity get name] . " @ " . [/system clock get date])

/system backup save name=$backupname
/tool e-mail send to=$emailaddress subject=$subject file=$backupname
:delay 10;
/file remove [/file find name="$backupname.backup"]
:log info "System backup emailed: $subject"

Who is online

Users browsing this forum: No registered users and 65 guests