Community discussions

 
sutrus
newbie
Topic Author
Posts: 27
Joined: Fri Jun 30, 2017 11:27 pm

Script on 6.41RC - fetch not working

Sat Oct 21, 2017 4:53 pm

Hello,
Sorry for my bad English.
I need an advice. My script is not working at 6.41RC on 6.40 OK.
Export to flash drive is OK but fetch to FTP is not working.
Mikrotik Log: ftp backup error: xxxxxxx

Log on my local FTP server. Address 192.168.1.1 login OK, but no write backup:
Image
:local hostname "RB962_Fug8";
:local ftpusername "name";
:local ftppassword "password";
:local ftpserverip "192.168.1.2";
:local ftpserverport "21";

:local time [/system clock get time];

# months array
:local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");

# extract month from date
:local datemonth [ :pick [/system clock get date] 0 3 ];

# get position of our month in the array = month number
:local mm ([ :find $months $datemonth -1 ] + 1);

# if month number is less than 10 (a single digit), then add a leading 0
:if ($mm < 10) do={
   :set datemonth ("0" . $mm);
# otherwise, just set it as the number
} else={
   :set datemonth $mm;
}

#create date format  dd_mm_yyyy
:local date ([:pick [/system clock get date] 4 6]."_". datemonth ."_". [:pick [/system clock get date] 7 11]);

:local filename "$hostname-$date-$time";

:log warning "ftp backup start: disk1/$filename.rsc";
/export file="disk1/$filename";

:local backupfile ("BackupMikrotik/" . filename . ".rsc");
:do {
  /tool fetch mode=ftp address=$ftpserverip port=$ftpserverport user=$ftpusername password=$ftppassword src-path="disk1/$filename.rsc" dst-path=$backupfile upload=yes;
   :log info "ftp backup OK: $backupfile";
} on-error={
   :log error "ftp backup error: $backupfile";
}

:delay 2s;
#/file remove "$filename.rsc"
 
simogere
newbie
Posts: 40
Joined: Fri May 24, 2013 11:54 am

Re: Script on 6.41RC - fetch not working

Mon May 14, 2018 1:27 pm

Any solution?
 
User avatar
dasiu
Trainer
Trainer
Posts: 232
Joined: Fri Jan 30, 2009 11:41 am
Location: Reading, UK
Contact:

Re: Script on 6.41RC - fetch not working

Mon May 14, 2018 4:54 pm

Have you tried running the "/tool fetch" command manually? Does it work? If not - can you put the output here?
 
simogere
newbie
Posts: 40
Joined: Fri May 24, 2013 11:54 am

Re: Script on 6.41RC - fetch not working

Mon May 14, 2018 5:31 pm

Have you tried running the "/tool fetch" command manually? Does it work? If not - can you put the output here?
It doesn't work manually too.

With filezilla it works.
status: failed

failure: connection timeout
 
VincentL
just joined
Posts: 11
Joined: Fri Feb 03, 2017 3:27 pm

Re: Script on 6.41RC - fetch not working

Wed Jan 30, 2019 3:55 pm

Hello,

Same problem here with 6.43.8. FTP server is "The Dude"
It works with fileZilla and WinSCP (ftp mode), but tool fetch doesn't works. It give to me "status: failed" ans "failure: connection timeout"
This is my command : /tool fetch address=x.x.x.x src-path=myscript.auto.rsc user=ftpuser mode=ftp password=ftppassword dst-path=myscript.auto.rsc port=21 keep-result=yes

Vincent
 
VincentL
just joined
Posts: 11
Joined: Fri Feb 03, 2017 3:27 pm

Re: Script on 6.41RC - fetch not working

Mon Feb 04, 2019 3:56 pm

Hello,
I found what's going wrong for me : Mikrotik tried to fetch script through public network gateway to resolve a private IP for the server which is on another site and connected with a VPN.
I opened a TFTP with a public IP.

Vincent

Who is online

Users browsing this forum: No registered users and 11 guests