Mondo whole disk backup script available UPDATED

takingky
Posts: 289
Member Since:
2006-09-18

Hi All

UPDATED May 9, 2007

Latest version of Mondo Suite

http://www.script-trix.us/files/MondoTrixBackup.pdf

This is complete guide to installing and configuring an automated backup solution using Mondo on Trixbox. I would recommend you download this and look at it.

Program available at

http://www.script-trix.us/diskbackup.htm

The web page has been updated extensively

OLD POST CONTINUES...

Based on some discussion by Damien in the help section I have created an all in one hard disk/partition backup script which should answer our needs. This schema is based on MONDO which is an open source backup product.

This has been tested with TB 2.0 and 2.1.5B with the centos kernels 2.6.9-32.0.2 and 2.6.9-42.0.10. This has been tested on lab machines and production machines. It has also been tested on vmware versions.

So far I have not been able to break this process however I am sure someone out there will.

Essentially the install-mondo.sh program installs mondo and all of the support programs onto your TB install. It also places a script file in the /etc/cron.weekly folder which is run once per week. The script, mondobackup.cron, runs mondo in a command line mode and generates cdrom sized ISO's and stores them on the local hard drive. NOTE THIS PROCESS TAKES A REALLY REALLY REALLY long time!!! Once mondo is finished the script continues and copies the ISO files to a remote FTP site and alternately a local USB hard drive (make sure it is big enough!) or a SMB SHARE
new ^^^^^^^^

If your TB system breaks Repair the hardware and then get the ISO files stored on your ftp server and burn them using any old burning software to a cdrom. Then insert the mindi disk and boot. Follow the onscreen prompts and your TB system is back. If you have been using my DailyBackup script you would then use freePbx's restore to restore your latest configs etc.

I have modified the install-mondo.sh and mondobackup.sh scripts to add full SMB Client support to the script. This feature will allow you to copy your backup ISO's to a Windows machine or another machine that runs SAMBA Server. My current problem is I am still writing the documentation however /etc/cron.weekly/mondobackup.cron source is documented albeit somewhat briefly. I should have the full docs up later today but the new files are available for download and install. NOTE the SMB transfer is turned off by default for the moment.

Until a few people have tested this it is still listed as experimental. There are detailed directions on the website for your perusal.

I will also be modifying my original daily backup scripts to provide full smbclient support.

Enjoy

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



jahyde
Posts: 2002
Member Since:
2006-06-02
This is what we need! How

This is what we need!

How about adding an option to send to SMB share - FTP transfer speed is limited. I know - its to get the thing offsite, but SMB would be a nice added option. If the script could also install the SMB client, and then add in some edited fields where the users specifies server and auth info. Also 700mb or 4.7 gb ISO's would be nice.

--

--my PBX is run on 2 V8's



takingky
Posts: 289
Member Since:
2006-09-18
perhaps

Gee give me a little time to go scuba diving!

THis is just a starting point which utilizes the most commonly available options. ftp and USB being out there the most. If you would care to contribute some of the smb stuff let me know and I will consider adding it as an option.

Currently the iso's that are produced are 690mb's. sigh after reading my post I left out one of the steps

what happens is there is a 3rd image created which is the actual bootable image it is called mindi.iso. You will need to burn this to a separate cd and put this disk in first and it will load Linux and the restore software. Mondo is capable of burning the bootable image to disk 1 however the current methodology prevents that thus a separate boot cd is required. Mondo will also burn DVD size ISO's however I am using most common denominator for this first version.

I am sure if you peruse the mondo docs you will find the ability to create bootable DVD's also.

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



kerryg
Posts: 6790
Member Since:
2006-05-31
This should become a project

This should become a project in the Forge and we should look at integrating it into the dashboard.

--

Kerry Garrison
http://www.VoipStore.com - http://3cxbook.com
(888) VOIPSTORE - (888) 864-7786



jahyde
Posts: 2002
Member Since:
2006-06-02
I would love to help - in a

I would love to help - in a month or so, booked to the hilt right now - thats why I get so excited when someone else makes it run right out of the shute ;)

--

--my PBX is run on 2 V8's



takingky
Posts: 289
Member Since:
2006-09-18
Will try to find the time

Will look into it at work later today. Don't use unix to windoze all that much. Don't get your hopes up though

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



takingky
Posts: 289
Member Since:
2006-09-18
your wish came true

I have released a new version of the script that now supports SMBClient shares. I am still working on the docs if you want to download and experiment with it. I have tested this mod fairly extensively.... seems to work just fine with W3K server. I did create a custom share on the W3K server for testing FYI. BTW finished testing USB key also works like a charm.

Mondo does allow you to change the default size of the ISO file with the command line. My goal here was to get a stable script first before adding all sorts of options. Once I am sure this script works and the schema is sound I will add some extra features.

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



unitetech
Posts: 121
Member Since:
2007-01-19
Thank You Tom!!!

This will save me a lot of time. Your scripts are key to making this work right. Great work Tom.

Damien



unitetech
Posts: 121
Member Since:
2007-01-19
Tried Script.

Man im tired. If I read your directions correctly I would not make stupid mistakes. Does that count when making it fail. :)
Damien



takingky
Posts: 289
Member Since:
2006-09-18
Stuff happens

Actually the directions are not really complete yet. I am still editing the revised directions and adding some screen captures. The document is large as I know how things can sometimes go wrong. I wanted to get this up and out there for the more adventuresome souls so I can get some feedback to find ways to improve it.

The big problem is this is a large piece of software with many options. This makes it easy to make mistakes....... thus the need for good documentation. Luckily I have a day off today so I can finish it up.

Thanks for your help on this.

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



ccataldo
Posts: 145
Member Since:
2006-06-01
Problem with Mondo restore

Thank you very much Tom for your effort.

Today I had to restore my production machine and the only problem I had was this, after the restore.

Loggin into the restored TB I got the following error, seen by other user cloning TB hard disks.

Warning: Division by zero in /var/www/html/maint/modules/01_Home/includes/os/class.Linux.inc.php on line 476

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/maint/modules/01_Home/includes/os/class.Linux.inc.php:476) in /var/www/html/maint/modules/01_Home/includes/system_header.php on line 25

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/maint/modules/01_Home/includes/os/class.Linux.inc.php:476) in /var/www/html/maint/modules/01_Home/includes/system_header.php on line 32

What could it be? How to fix?



takingky
Posts: 289
Member Since:
2006-09-18
What version of TB are you using?

The line it is referring to appears to be something to do with the system information script and seems to refer to the swap drive. I would hazard a guess that it doesn't like the new swap drive partition or location.

Does your system work?

where do you see this error? In the web interface? In the CLI?

Did you restore to the same physical drive or did you put in a new drive with different geometry?

When I performed my testing prior to releasing it I did not have any problems on my 2.0 production machines with this error. The tests for TB 2.X were not as extensive as I only have 5 or so machines in the lab running the 2.X version. I have always restored to the same drive geometry, although mondo will restore to other geometries but you will have to go thru the mondo manual to figure out how to do this.

I have not actually explored that code yet so perhaps someone more familiar with the true function of it could enlighten us.

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



ccataldo
Posts: 145
Member Since:
2006-06-01
The System works

...I see the error, like other users while logging into TB GUI on the same machine with the same previous HD

search here with the word "cloning"

To partially fix it I had to reinstall the phpsysinfo. The error stille remains in the

/var/www/html/user/modules/01_Home directory



MillsapsPE
Posts: 385
Member Since:
2006-06-09
d/l error

I get the following error when I try to d/l the script. Is this a problem on my end or on the web server?

[root@asterisk1 ~]# wget https://script-trix.us/files/install-mondo.sh.gz
--17:35:17-- https://script-trix.us/files/install-mondo.sh.gz
=> `install-mondo.sh.gz'
Resolving script-trix.us... 68.178.254.7
Connecting to script-trix.us|68.178.254.7|:443... failed: Connection refused.



takingky
Posts: 289
Member Since:
2006-09-18
d/l error

wget https://script-trix.us/files/install-mondo.sh.gz
^

dont use https!

wget http://script-trix.us/files/install-mondo.sh.gz

Just tried it and it works fine

Tom

sigh I know I need to get a cert on the site.........

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



MillsapsPE
Posts: 385
Member Since:
2006-06-09
I had tried as normal http,

I had tried as normal http, but got same result. Now when I do it, it works. Either way, thanks for the script.



takingky
Posts: 289
Member Since:
2006-09-18
Sometimes the host of the website goes insane

is the only thing I can say.... Complained a number of times but when I get thru to tech support it is always back up..... sigh

Glad you got it.

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



MillsapsPE
Posts: 385
Member Since:
2006-06-09
For testing purposes, I'm

For testing purposes, I'm trying to ftp the backup file from my test box to another TB unit on the same network. The test box is 192.168.1.24 and the operating TB is 192.168.1.20. The script is installed on the test box.

I get the following error when running the script:
[root@asterisk1 cron.weekly]# ./mondobackup.cron
KERBEROS_V4 rejected as an authentication type
ftp: connect: Connection timed out
ftp: connect: Connection timed out
ftp: connect: Connection timed out
ftp: connect: Connection timed out
ftp: connect: Connection timed out

But, when I check mondobackup.log, it looks like it worked.

=======================================================
Begin copying files to ftp server
Connected to 192.168.1.20 (192.168.1.20).
220 Welcome to TalkPBX FTP service.
331 Please specify the password.
230 Login successful.
200 Switching to Binary mode.
250 Directory successfully changed.
local: mindi.iso remote: mindi.iso
227 Entering Passive Mode (67,11,208,226,70,65)
local: mondorescue-1.iso remote: mondorescue-1.iso
227 Entering Passive Mode (67,11,208,226,237,203)
local: mondorescue-2.iso remote: mondorescue-2.iso
227 Entering Passive Mode (67,11,208,226,247,17)
227 Entering Passive Mode (67,11,208,226,247,34)
221 Goodbye.
Finished copying files to ftp server
=======================================================
Copy files to USB drive NOT enabled
Copy files to SMB Share NOT enabled. No Files Copied to SMB Share
=======================================================
Performing post backup cleanup
removed `/backup/mindi.iso'
removed `/backup/mondorescue-1.iso'
removed `/backup/mondorescue-2.iso'
=======================================================

Any ideas?



takingky
Posts: 289
Member Since:
2006-09-18
Generally====

it appears that your ftp connection timed out. Now that being said the script should have done an ls -al after the upload which would indicate a good copy. I don't see that of course.

I assume you have taken the usual test for trying to log in from the .24 box to the .20 box in the CLI? What user did you assign as the ftp user and what privilege do they have?

Normally I create a new user specifically for ftp use, disable anonymous login, and give the ftpuser read/write/modify privs for a specific directory. I never use the built in users such as root/maint/etc......

When I developed this script I was connecting into a whopper W2K box with 5 TB of storage.... works over here 8^) I also created a special user and only have them r/w/c privs to a specific directory.

I suppose you should try logging in manually to you .20 and see if ftp is up and running and the user has r/w/c privs. I recommend you try to upload a file.

I am a little unhappy with the ftp and the error trapping and have been meaning to work on it some but my paying job keeps getting in the way.....

Let me know your results. I am not sure of your technical ability so I apologize in advance if the questions I am asking are noobie types. No offense.

best regards

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



MillsapsPE
Posts: 385
Member Since:
2006-06-09
I have the default vsftpd

I have the default vsftpd user name and password. My polycom's can log into the .20 box using ftp and I can log into it via SmartFTP on my XP laptop. The permissions are set at 0777.

This is what I get when I connect from the .24 box to the .20 box:
[root@asterisk1 ~]# ftp 192.168.1.20
Connected to 192.168.1.20.
220 Welcome.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (192.168.1.20:root): ftpuser
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

I don't know how to transer files using the CLI.

trying something else...
I changed the setup such that it now uploads to an offsite ftp server. It appears to be working (uploading as I type).



takingky
Posts: 289
Member Since:
2006-09-18
looks good so far

the way to transfer in ftp with out typing too much is

In the cli prior to starting ftp

cd /root

(I will assume you have a medium size file in your root directory called test.txt or whatever)

Login to ftp as you have already done

type

bin and then tap the ENTER key

type

put test.txt and then tap the ENTER key

This should transfer the file to your remote ftp server. In order to do multiple files just type mput *

I will try to play with the ftp server in a TB tomorrow sometime.

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



unitetech
Posts: 121
Member Since:
2007-01-19
New Mondo Works

Tom,

Have you had a chance to update your scripts to the latest mondo and mindi. They both now work. The Mondo team got it fixed and I did test it good.

Thanks
Damien



takingky
Posts: 289
Member Since:
2006-09-18
please confirm

the latest numbers you are using. I will then update things. Also any changes to the command line that you are aware of?

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



unitetech
Posts: 121
Member Since:
2007-01-19
Mondo and Mindi Latest Version

I used the same command and it worked fine. Someone also posted another version of the command on my mondo how to blog that had good potential to define what size you wanted the ISO to be. Below are the versions I tested and I think the order of install.

yum -y install cdrecord
mindi-busybox-1.2.2-2.rhel4.i586.rpm
mindi-1.2.3-1.rhel4.i586.rpm
afio-2.4.7-1.i586.rpm
buffer-1.19-1.i386.rpm
mondo-2.2.3-1.rhel4.i586.rpm

Let me know when you have updated the scripts and I will test them too.

Thanks buddy
Damien



takingky
Posts: 289
Member Since:
2006-09-18
New version is now available for download

I have made the requisite changes and placed them up for download on my website.

Thanks for keeping the versions up to date.... I run out of time these days..... I have been splitting my time between the puters and teaching scuba now that the weather has broken 8^>

http://www.script-trix.us/diskbackup.htm

I finally got the trix backup project approved and on the forge so I will be moving it over to the forge over the next little while. I plan to replace the bash scripts with php/perl and provide some type of gui that can be run in the web browser......

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



jozwikjp
Posts: 145
Member Since:
2007-01-04
Did you find a fix for your

Did you find a fix for your Home page error..

Warning: Division by zero in /var/www/html/maint/modules/01_Home/includes/os/class.Linux.inc.php on line 476



takingky
Posts: 289
Member Since:
2006-09-18
the short answer

No

The long answer

Still looking

The error is minor. Reinstalling PHPinfo seems to help some but the problem still exists. I have been chasing other bugs which tend to stop * at the moment. Will post if a fix exists.

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



rrichiez
Posts: 566
Member Since:
2006-12-07
Have the same php info problem

Tom where did you and how did you instal the php info. And did you ever fixed the 476 line issue i get the same erros as mentioned all the way above and have found no solution my box works great but this is the only thing thats keeping me awake.

rrichiez



takingky
Posts: 289
Member Since:
2006-09-18
yumex

is my tool of choice for adding and removing stuff. Course it only works under Xwin 8^)

Never found a solution for the problem... all of my production boxes have the same error now and all work flawlessly. I must admit it has dropped to the bottom of the pile right now as I am busy porting all of my scripts over to work with TB2.3B right now. many headaches so far!

Tom

--

===============================
Get scripts to make your life easier
http://www.script-trix.us
===============================



kmobarek
Posts: 6
Member Since:
2007-07-12
script-trix no files available

I am unable to get any mondo backup (or anything else for that matter) from script-trix. It just presents very generic advertising page with the url showing a 404=y in the request string. I am assunimg that this is a 404, page not found http error. anyone have the backup and restore scripts for trixbox (whole disk)



mwood
Posts: 48
Member Since:
2006-05-31
try

barmstrong
Posts: 29
Member Since:
2006-12-09
I think they let their

I think they let their domain registration laps. Does anyone know if there is a way to install this in tb 2.6.1? It sounds like a great feature. It would go well with the new backup tool to have it as an option.



tazzrass
Posts: 1
Member Since:
2009-05-22
Where did they go?

Does any one know where we can find these scripts any more? This would be a really nice feature to add.



huebs73
Posts: 294
Member Since:
2006-09-27
It's my understanding that

It's my understanding that Mondo has issues with Centos 5.x ...but my research here is limited at best. Tom King was sort of shunned from the community a long time ago for coming up with all sorts of hacks that when implemented made it impossible to have a support system like Fonality was trying to (at that time) get off the ground. He's a developer over at http://www.pbxinaflash.com/

--

http://www.bullzeyenetworks.biz
Great deals on analog and T1/PRI cards!
PM me if you want a coupon for even better pricing!



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.