Community discussions

MUM Europe 2020
 
dormador
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Sat Mar 28, 2009 12:57 pm

V4 dynip+backup system+usermanger not work !

Wed Oct 14, 2009 8:52 pm

Hi every body

am using changeip for give me the last change ip +script that backup database and send it to my e-mail ... the problem comes after last update V4 ... no script work.

i have 2 important script 1-for change ip 2- script that sent to e-mail system+usermanger database.

solution gentleman



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

Re: V4 dynip+backup system+usermanger not work !

Thu Oct 15, 2009 12:11 am

a solution? the problem is "some of my scripts don't work, but I won't show you the scripts. please, guess what's the problem with them"
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.
 
dormador
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Sat Mar 28, 2009 12:57 pm

Re: V4 dynip+backup system+usermanger not work !

Thu Oct 15, 2009 12:20 pm

thanks Mr.Chupaka for your replaying

i was think some one told me .. the all script in last version not work in this version because there are changing in the basic of programing...

i well print the scripts but am Sure that the defect lies in the new version and not in the same scripts
Because it was working to the fullest as well as many of my friends..

my script

the script for backup system ((all the system hotspot broadband ...etc))
:log info "backup beginning now"
:global backupfile ([/system identity get name] . "-" . [/system clock get time])
/system backup save name=$backupfile
:log info "backup pausing for 10s"
:delay 10s
:log info "backup being emailed"
/tool e-mail send to="your e-mail@gmail.com" subject=([/system identity get name] . \
" Backup") from=<MIKROTIK> file=$backupfile 
:log info "backup finished"
the script for backup usermanger ((great script when backup new update delete the last one...not like the system backup give you new one in every backup))
/tool user-manager database save name=email;
/tool e-mail send to="your e-mail@gmail.com" subject=([/system identity get name]." umb") file=email.umb;
:log info "Backup e-mail sent.";  }
the script for change ip thats all one know about it
# Define User Variables
:global ddnsuser "username"
:global ddnspass "pass"
:global ddnshost "******"

# Define Global Variables
:global ddnsip
:global ddnslastip
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }

:global ddnsinterface
:global ddnssystem ("mt-" . [/system package get system version] )

# Define Local Variables
:local int

# Loop thru interfaces and look for ones containing
# default gateways without routing-marks
:foreach int in=[/ip route find dst-address=0.0.0.0/0 active=yes ] do={ 
  :if ([:typeof [/ip route get $int routing-mark ]] != str ) do={
     :global ddnsinterface [/ip route get $int interface]
  } 
}

# Grab the current IP address on that interface.
:global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface ] address ]

# Did we get an IP address to compare?
:if ([ :typeof $ddnsip ] = nil ) do={
   :log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={

  :if ($ddnsip != $ddnslastip) do={

    :log info "DDNS: Sending UPDATE!"
    :log info [ :put [/tool dns-update name=$ddnshost address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ] ]
    :global ddnslastip $ddnsip

  } else={ 
    :log info "DDNS: No update required."
  }

}

# End of script
this is my scripts and i need it all ...

thanks for your help and am waiting

regards

________
sorry for bad English
but what can i do...the Mikrotk is Global and served human in all over the world : )
 
dormador
Member Candidate
Member Candidate
Topic Author
Posts: 107
Joined: Sat Mar 28, 2009 12:57 pm

Re: V4 dynip+backup system+usermanger not work !

Fri Oct 16, 2009 6:47 pm

Gentleman
Am I the only time in this issue
Is there a promoted version did not encounter this problem
I do not want a solution to be a matter of fact, please
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8320
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: V4 dynip+backup system+usermanger not work !

Fri Oct 16, 2009 11:49 pm

http://wiki.mikrotik.com/wiki/Dynamic_D ... angeIP.com - there's already version of ChangeIP script for v4
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.

Who is online

Users browsing this forum: No registered users and 14 guests