• MikroTik.com
  • RouterBOARD
  • User Meeting
  • Training
  • User Manual
  • Support
  • Downloads
  • Videos
Register |   * Login | HOME

View unanswered posts | View active topics

Script for making automatic Dude backup's remotely  Page 1 of 1
 [ 16 posts ]  Post new topic Reply to topic
  Print view Previous topic | Next topic 
Author Message
Phase
 Post subject: Script for making automatic Dude backup's remotely
PostPosted: Wed Aug 05, 2009 4:04 pm 
Offline
just joined

Joined: Tue Jul 07, 2009 8:20 am
Posts: 4
Karma: 0

Location: Ukraine
Hi all!

Here is my script for making dude backup's from PC's remotely. Probably, it will be useful for someone.
It requires:
  • Bourne shell (sh)
  • awk
  • wget

To start using it just fill your admin login, password and server name and add to cron (or start by hand).
Backup XML files and log by default will be placed in "dude-backup-files" subdirectory. You can change this option if you need this.

Tested on FreeBSD 6.2, RouterOS 3.28 (x86), Dude 3.4.



------------------------------------------------
* ver 1.0 - first public release
* ver 1.1 - fixed work with cron


Attachments:
dude-backup-v1.1p.zip [1.25 KiB]
Downloaded 655 times


Last edited by Phase on Sun Aug 23, 2009 9:46 pm, edited 1 time in total.
Top
 Profile  
 
dssmiktik
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Thu Aug 06, 2009 6:55 pm 
Offline
Forum Veteran
Forum Veteran

Joined: Fri Aug 17, 2007 7:42 am
Posts: 729
Karma: 22
I can't seem to get it working on 3.27 x86 dude 3.4. I don't think it's your script though because I can't download from the web interface either: Import/Export -> Dude configuration XML export. Attached is the log generated from your script.

Any ideas?


Attachments:
log.txt [1.17 KiB]
Downloaded 273 times

_________________
Doug
Top
 Profile  
 
Phase
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Fri Aug 07, 2009 9:20 am 
Offline
just joined

Joined: Tue Jul 07, 2009 8:20 am
Posts: 4
Karma: 0

Location: Ukraine
This script just automatize backup procedure through web-interface. If you cannot receive a copy through the web interface then also the script will not work.


Top
 Profile  
 
dssmiktik
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Fri Aug 07, 2009 10:03 pm 
Offline
Forum Veteran
Forum Veteran

Joined: Fri Aug 17, 2007 7:42 am
Posts: 729
Karma: 22
That makes sense.

_________________
Doug


Top
 Profile  
 
Phase
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Sun Aug 23, 2009 9:56 pm 
Offline
just joined

Joined: Tue Jul 07, 2009 8:20 am
Posts: 4
Karma: 0

Location: Ukraine
Today I have detected very unpleasant error in a script. Through this error it was not work with cron.

All, who use script must update to ver 1.1.


Top
 Profile  
 
rferroni
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Thu Oct 01, 2009 9:23 pm 
Offline
just joined

Joined: Wed Sep 13, 2006 10:37 pm
Posts: 12
Karma: 0
thanks!!! it's realy helpful.
/rodrigo


Top
 Profile  
 
ltsakev
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Fri Jun 11, 2010 8:21 am 
Offline
just joined
User avatar

Joined: Fri Jun 11, 2010 8:15 am
Posts: 2
Karma: 0

Location: Bulgaria
Hi guys,
the theme and it was interesting to see if it worked? I want to attach an example which IP addresses where to and that you can make backup of the Windows OS.
I would be grateful if you attach a picture of your patterns and where IP addresses are printed insert asterisks.

best regards

_________________
<<Chicken, fish and women consume them with his hands and then wash them!>>
Cent-OS, RouterOS 3.30 (x86), Dude 3.6
¿ʞO 'uǝ SOɹǝʇnoɹ ʞıʇoɹʞıW ɯ‚|


Top
 Profile  
 
gsandul
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Fri Jun 11, 2010 8:59 am 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Mon Oct 19, 2009 12:42 pm
Posts: 154
Karma: 22
It works greate.
The only problem may appear because the dude sometimes stops responding on WEB interface.
It cause backup to fail.

Quote:
I would be grateful if you attach a picture of your patterns and where IP addresses are printed insert asterisks.

what do you mean a picture of your patterns?

_________________
Increase my Karma :) http://forum.mikrotik.com/viewtopic.php?f=8&t=41148


Top
 Profile  
 
ltsakev
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Fri Jun 11, 2010 9:39 am 
Offline
just joined
User avatar

Joined: Fri Jun 11, 2010 8:15 am
Posts: 2
Karma: 0

Location: Bulgaria
I fixed it did is, it works great. We try to get him not to delete backups from previous days, and keep backups 1 week?!

_________________
<<Chicken, fish and women consume them with his hands and then wash them!>>
Cent-OS, RouterOS 3.30 (x86), Dude 3.6
¿ʞO 'uǝ SOɹǝʇnoɹ ʞıʇoɹʞıW ɯ‚|


Top
 Profile  
 
gsandul
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Fri Jun 11, 2010 11:21 am 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Mon Oct 19, 2009 12:42 pm
Posts: 154
Karma: 22
Quote:
We try to get him not to delete backups from previous days, and keep backups 1 week?!


I just commented

# rm -f $backupdir/old/*
# rm -d $backupdir/old

and sheduled the cron on my FreeBSD to delete backup files older then 10 days.

25 01 * * * /usr/bin/find /usr/dudebackup/data/old/ -name "*" -mtime +10 -exec rm -f {} \;

_________________
Increase my Karma :) http://forum.mikrotik.com/viewtopic.php?f=8&t=41148


Top
 Profile  
 
ormwish
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Thu Jul 08, 2010 7:03 am 
Offline
just joined

Joined: Tue Jul 06, 2010 10:27 pm
Posts: 16
Karma: 0

Location: Russia, Saint-Petersburg
Cool script. simple, useful, scalable.

But i have a problem. Seriously problem.
My network contents over 7k devices.
I understand, that Dude don't keep their config anytime on harddrive, rewriting with certain interval. Dude generate their XML from RAM ? On my server, with 700 devices on monitoring with Dude(other devices planned after all troubles will defeat), when i start backup XML - for generating process Dude "eat" ~20 min. and after this time i have download dialog.
In this view - we have a big trouble. WGET send request for autorization, after that download. De jure - download has start. De facto - start the process of generating XML-code and only then download will start.
How result we have 0B downloaded *.xml file.

may be who know solution for this trouble?


Top
 Profile  
 
gsandul
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Thu Jul 08, 2010 9:34 am 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Mon Oct 19, 2009 12:42 pm
Posts: 154
Karma: 22
Hi, ormwish
Probably you should move to Dude 4.0 Beta.
The backup on 4.0 is faster and backup file size is lower (in my case it is redused for 10 times from 120Mb to 12Mb).

_________________
Increase my Karma :) http://forum.mikrotik.com/viewtopic.php?f=8&t=41148


Top
 Profile  
 
ormwish
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Thu Jul 08, 2010 11:38 am 
Offline
just joined

Joined: Tue Jul 06, 2010 10:27 pm
Posts: 16
Karma: 0

Location: Russia, Saint-Petersburg
Code:
Запрос HTTP послан, ожидание ответа...
  HTTP/1.0 200 OK
  Connection: close
  Content-Length: 0
  Content-Type: text/xml
  Date: Thu, 08 Jul 2010 09:12:15 GMT
  Expires: 0
Длина: игнорируется [text/xml]
Saving to: «/home/backup/dude-backup/data/dude-backup-2010.07.08.xml»

     0K                                                       0,00 =0s

2010-07-08 13:03:08 (0,00 B/s) - «/home/backup/dude-backup/data/dude-backup-2010.07.08.xml» saved [0]


It's WGET output, when i run the script. Why Content-Lenght = 0? 0_o. May be because the dude 3.6 returns Content-Length=0 in their headers while generating, and sends the additional HTTP-request with correct headers when XML was generated? Then i have question. How make script is cath this request (if this reasons are true)

Gsandul, thanks for solution. Probably'll do.
May be offtop, but did you know about upgrading dude 2.2 to 3.6 or 4(beta) and 3.6 to 4(beta)?
May possible to data loss, misrepresentation,distortion of topology on maps, missing probes, etc.?

Our Company buying other ISP, and their using Dude 2.2 for monitoring services on devices, so i ask.
In the near future, I plan to consolidate both servers as monitoring-agents. This requires reduction to a single version.


UP. Content-Lenght = 0 because harddrive is full. Not awailable space required for backup.


Top
 Profile  
 
Phase
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Tue Jul 13, 2010 10:46 am 
Offline
just joined

Joined: Tue Jul 07, 2009 8:20 am
Posts: 4
Karma: 0

Location: Ukraine
For statistics:
The last backup copy received by a script has more than 100 Mb and procedure of its generation has occupied almost 5 minutes.

(Dude 3.6 on RouterOS 4.10 x86, ~600 devices).


Top
 Profile  
 
ormwish
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Tue Jul 20, 2010 6:22 pm 
Offline
just joined

Joined: Tue Jul 06, 2010 10:27 pm
Posts: 16
Karma: 0

Location: Russia, Saint-Petersburg
thank you, Phase!

Rus: Постараюсь написать скрипт, который бы структуру дудового стораджа(то же что и бэкап) забирал по scp.
Eng: I'll try to write a script that would pick up the structure Dude storage(the same as backup) via scp.


Top
 Profile  
 
Fated
 Post subject: Re: Script for making automatic Dude backup's remotely
PostPosted: Fri Feb 03, 2012 3:54 pm 
Offline
just joined

Joined: Sat Dec 10, 2011 3:42 pm
Posts: 8
Karma: 0
there is a same script that will upload config. in dude? Thx


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 16 posts ] 

Board index » Other topics » The Dude

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Karma functions powered by Karma MOD © 2007, 2009 m157y