0% found this document useful (0 votes)
10 views10 pages

Manual Backup3 en

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views10 pages

Manual Backup3 en

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

IPBrick

Creating Backups on IPBrick

iPortalMais - Soluções de Engenharia para Internet e Redes, Lda.

February 2010
2

Copyright c iPortalMais
All rights reserved. February 2010.
The information contained in this document is subject to alterations without prior notice. Statements,
technical data, configurations and recommendations found in this document are supposedly precise and
reliable, but are presented without expressed or implicit warranties.

Creating Backups on IPBrick iPortalMais


Contents

1 Purpose of this document 5

2 Backup to USB disk 7

3 Backup to a shared folder in a Windows based machine 9

iPortalMais Creating Backups on IPBrick


4 CONTENTS

Creating Backups on IPBrick iPortalMais


Chapter 1

Purpose of this document

This document intends to demonstrate a couple of ways of doing backup on IPBrick, should there be
no backup drive. These are the two ways:
• Backup to USB disk;
• Backup to a shared folder in a Windows based machine.

The file manual backups files.tar.gz, that can be downloaded at http://www.ipbrick.com/pt/


documentacao contains all the documents mentioned in this manual.

iPortalMais Creating Backups on IPBrick


6 Purpose of this document

Creating Backups on IPBrick iPortalMais


Chapter 2

Backup to USB disk

In this first scenario there’s a USB disk connected to an IPBrick. First, it’s necessary to know in
which device is the USB disk. After establishing the connection between the USB disk to the IPBrick,
the console of the IPBrick will show the following messages:

usb 1-3: new high speed USB device using ehci hcd and address 2
scsi4 : SCSI emulation for USB Mass Storage devices
usb.agent[6670]: usb-storage: already loaded
Vendor: SKYMEDI Model: USB 2.0 Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 254208 512-byte hdwr sectors (130 MB)
sda: Write Protect is off
SCSI device sda: 254208 512-byte hdwr sectors (130 MB)
sda: Write Protect is off
sda: unknown partition table
Attached scsi removable disk sda at scsi4, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi4, channel 0, id 0, lun 0, type 0
sd mod: loaded sucessfully (for disk)

Written in bold is the indication of which device you’ll need for the next step. This same information
can be obtained through the command dmesg.
After knowing the device of the USB disk, it’s necessary to take these following steps:

1. Create a directory (/home1/ backupusb/, for example1 ) in IPBrick. Run:


mkdir /home1/ backupusb
2. Ensure that the USB disk is already formatted. If not:

• Create partition. Run:


cfdisk /dev/sda;
• Format partition. Run:
mkfs.ext3 /dev/sda1;

3. Mount USB disk at /home1/ backupusb (where /dev/sda is the device formerly mentioned). Com-
mand:
mount /dev/sda /home1/ backupusb
4. Transfer the script rsync USB.sh to the IPBrick (ftp, samba,..);
5. Make it certain that you have permission to execute. Run:
chmod 755 rsync USB.sh;
6. Run the script sh rsync USB.sh.

This script garanties the backup of the following directories:


• /home1;
• /home2;
1 Preferentially, the backup should be done to one of the homes of IPBrick
iPortalMais Creating Backups on IPBrick
8 Backup to USB disk

• /opt;
• /etc;
• /var/lib/ldap;

• /var/lib/postgres;
• /var/lib/postgres2.
The benefit of this method is to allow incremental backups, the first backup to be done copies all the
data, i.e. total backup. If on the following day another backup is done, only the altered data is transfered.

Creating Backups on IPBrick iPortalMais


Chapter 3

Backup to a shared folder in a


Windows based machine

The second method permits you to save a shared folder in Windows the data in the IPBrick. The
following directories are preserved:

• /etc;

• /var/lib/postgres*;

• /var/lib/ldap

• /opt;

• /home1;

• /home2.

These are the steps to be taken:

1. Transfer the file win backup.tgz to the IPBrick (via FTP, Samba, etc)

2. Extract from root (/). Run:


tar -zxvf /home/administrator/conta/win backup.tgz

3. Edit and configure these files:

• /opt/ipbox/backupSYS/ip+backupWIN;
The first step is to remove the comment from the following blocs of text. If you intend using
smbfs to connect to the shared folder, the comment should be removed from the last 5 lines of
the first bloc. If you intend to use cifs it’s necessary to remove the comment from the 5 lines
of the last bloc.

#SMBFS
#SRVTYPE=smbfs
#OUTSHARE=//server/sharename
#USER=domain\\login
#PASSE=password
#MNTOPTS=" -o username=${USER},password=${PASSE} "

#CIFS
#SRVTYPE=cifs
#OUTSHARE=//server/sharename
#USER=domain\\login
#PASSE=password
#MNTOPTS=" -o username=${USER},password=${PASSE} "

In both cases it is necessary to define the following variables:


– OUTSHARE: sharing at server;
Example: OUTSHARE=//atena/partilha
iPortalMais Creating Backups on IPBrick
10 Backup to a shared folder in a Windows based machine

– USER: name of the user with access to the shared folder;


Exemplo: USER=iportalmais\administrator
– PASS: password of the previous user;
Example: PASS=123456
– USER ADMIN: indicate here the e-mail address of the administrator;
Example: USER [email protected]
• /opt/ipbox/backupSYS/ip+size mv.sh;

The following variables


– RFOLDER;
– TEMPLATE.
exist in both scripts and it’s mandatory to have the same values on both scripts.
4. Place the script at /etc/crontab1 (similar to the Scheduled Tasks in Windows) and set it to the
hour intended.

1 For more informations about crontab run man crontab.


Creating Backups on IPBrick iPortalMais

You might also like