Koozali.org: home of the SME Server

What is the correct way to Mout the SME server on other lin*x machine.

Offline mgic_box

  • ***
  • 52
  • +0/-0

Hello Everybody.

I have a lin*x machine running, witch makes backups of several server's on the network.

I know that SME as wonderful tools and add-ons that can do the work, but we are a small (very small) enterprise, and we do not afford money to set up a new machine to only backup the SME server. So in conclusion, I want to use the already set-up and running lin*x machine to make backups of SME server too.

To do that, I need to be able to mount the SME files on the backup server.

The scripts already running, do the fallowing:

mount -t smbfs -o username=admin,password=pas //ip_add_of_SME/Admin/ /mnt/www_mail   

With this command, I get mounted the Admin home folder.

If I would backup the Primary I-bay, o should replace the above command by:
mount -t smbfs -o username=admin,password=pas //ip_add_of_SME/Primary/ /mnt/www_mail   

As I have several I-Bays, If I would like to backup the xpto I-bay, o should replace the above command by:
mount -t smbfs -o username=admin,password=pas //ip_add_of_SME/xpto / /mnt/www_mail   

And so on.

Question:

Is there a way, to mount all the I-Bays at once, lets, say, the

/home/e-smith/files/ibays folder?

Regards.


Offline Stefano

  • *
  • 10,894
  • +3/-0
hi

you can do a simple loop like:

Code: [Select]
#!/bin/bash
lista_mount=(Admin Primary otheribay)

for ibay in ${lista_mount[@]}; do
mount -t smbfs -o username=admin,password=pas //ip_add_of_SME/ibay$ /mnt/www_mail
put here your backup routine
umount /mnt/www_mail
done

HTH

ciao
Stefano

Offline mgic_box

  • ***
  • 52
  • +0/-0
hi

you can do a simple loop like:

Code: [Select]
#!/bin/bash
lista_mount=(Admin Primary otheribay)

for ibay in ${lista_mount[@]}; do
mount -t smbfs -o username=admin,password=pas //ip_add_of_SME/ibay$ /mnt/www_mail
put here your backup routine
umount /mnt/www_mail
done

HTH

ciao
Stefano


Tank you for your reply, help and for the fast reply

I changed a little your script , the fallowing way:

 
Code: [Select]
lista_mount=(Admin Primary i_bay1 i_bay2)

for ibay in ${lista_mount[@]}; do
mkdir /mnt/www_mail/$ibay
mount -t smbfs -o username=admin,password=123 //ip/$ibay /mnt/www_mail/$ibay

umount /mnt/www_mail/$ibay
done

But now I have two (2) anther problems

1-   How to mount the home user files, this means:

/home/e-smith/files/users


2-   Always that I create another I-bay, I have to change the backup routine (not forget). But that’s ok for me.

Regards.


Offline Stefano

  • *
  • 10,894
  • +3/-0
Hi

I think you can not mount users' homes.. and, for sure, yes .

so, you could install affa or backuppc on your backup server then backup automagically Sme server.

HTH
Ciao
Stefano


Offline mgic_box

  • ***
  • 52
  • +0/-0
Hi

I think you can not mount users' homes.. and, for sure, yes .

so, you could install affa or backuppc on your backup server then backup automagically Sme server.

HTH
Ciao
Stefano




 Thank you quick and fast reply, and help

 This does not solves to, because, we are a small, very small enterprise, and we do not have extra space on the server to do the backups on the server, this would imply do duplicate or trip. the space on disc to hold the original files and the backups

 In addition, doing backups to the same server, is not a good idea, as if we lost or... something on the server, we lose the original, and the backup too.
 
 AnyOne as a better solution?

  Regrds

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Quote
so, you could install affa or backuppc on your backup server then backup automagically Sme server.

mgic_box,
I think you don't understand suggestion. Install this on the machine you call Lin*x.
« Last Edit: May 07, 2008, 04:22:13 PM by mercyh »

Offline Stefano

  • *
  • 10,894
  • +3/-0
Hi..

ok.. I misunderstood..

you can use rsync on your lin*x server to backup sme server..

search on google for "remote rsync backup".. in this case you have not to modify/touch your sme server..

here http://ubuntuforums.org/showthread.php?t=639979 you'd find a good start point.

HTH
Ciao
stefano

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
You could also install this http://wiki.contribs.org/DAR2 on the SME and push the backup to a workstation or server share.

Offline dmay

  • *
  • 450
  • +0/-0
    • http://myezserver.com
You could also install this http://wiki.contribs.org/DAR2 on the SME and push the backup to a workstation or server share.

In mgic_box's scenario the dar2 target could simply be a share on the aforementioned lin*x machine. Also a packaged contrib would be the preferred backup method as the contribs backup all the configuration + data + ownership rights necessary to perform a full disaster recovery.

Darrell

Offline mgic_box

  • ***
  • 52
  • +0/-0
Hello,

I think I found e better and cleaner way to do that, for me, no package, no loop "for …; do", no additional sw. ...

On SME server:

Go to /home/e-smith/files/users/admin/home
Create a folder, lets-say for instance files_home
(
Code: [Select]
mkdir files_home)
do a mount, as fallows


Code: [Select]
mount --bind /home/e-smith/files/ files_home/On the machine I called lin*x (it is really a version of lin*x – but not SME, nor centOS), do:

Code: [Select]
mount -t smbfs -o username=admin,password=123 //ip/Admin/ /mnt/www_mail
Now I can brose to the folder /mnt/www_mail/files_home
and (on SME server) I am on the folder /home/e-smith/files/,and in a once I can ran the backup routine on user (all) and ebays (all) files.

Thank for all the replies, I promise, that when I have time, I will have a look at al the suggested packages.

Regards.
« Last Edit: May 07, 2008, 05:19:26 PM by mgic_box »

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Quote
I promise, that when I have time, I will have a look at al the suggested packages.

No need if you have something that works.

One paragraph of warning from somebody with burned fingers.

I was using a backup routine (With windows, not Lin*x) that was a bit like what you are doing. I lost the server by stupid actions on my part during the 6.x to 7.0 upgrade. When I did the restore I found that all file ownership and permissions had been lost. This may not be a problem with linux as the backup filesystem. In my case I was able to retrieve the Mission Critical data (by rebuilding all the permissions and ownership by hand) but all settings and other misc. were lost. I ended up working 30hrs straight and learned a valuable lesson about backups.

1. Use software approved for your OS
2. Check the logs daily.
3. TEST YOUR RESTORE ROUTINE WELL, OFTEN and COMPLETELY.

Good luck and Good Day,
Royce Holdeman

Offline mgic_box

  • ***
  • 52
  • +0/-0

I was using a backup routine (With windows, not Lin*x) that was a bit like what you are doing. I lost the server by stupid actions on my part during the 6.x to 7.0 upgrade. When I did the restore I found that all file ownership and permissions had been lost. This may not be a problem with linux as the backup filesystem. In my case I was able to retrieve the Mission Critical data (by rebuilding all the permissions and ownership by hand) but all settings and other misc. were lost. I ended up working 30hrs straight and learned a valuable lesson about backups.

1. Use software approved for your OS




It’s because of this, and other things that I do not rely on windows tools to do backups.
I prefer to use li*x.
I even use li*x to backup win*s.
I like to be able, to have a file, to look inside it, and see that may files are there…
I do not rely on tools that net several conditions (this or that sw, this or that hardware, previous files or backups… and so on), to be able to restore the files, or even to see what’s inside.
I am sorry; I am an old gay, used to the old tolls.

A “tar czvfp …“ does wonderful things…!!!

The tar and gzip formats are so universal that, I can, even on windows see and restore what’s inside a tar.gz file…!!! And the inverse I think there are not.

Additionally, I can give you more hints, I prefer to make the backups to a partition formatted according a format that can be red/written on win*s and Lin*x, for instance, I prefer to use fat32 or ntfs, instead of other types of partitions. So, this way, (in case of…) I can walkways, take of the disk, and put it on another machine….

 Regards.
« Last Edit: May 16, 2008, 12:08:54 PM by mgic_box »