Koozali.org: home of the SME Server

[ANNOUNCEMENT] Turn SME7 into a dedicated backup server

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
[ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #90 on: July 03, 2007, 06:47:38 PM »
Bug solved in version 0.6.2
Sophie from Montréal

markseymour

[ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #91 on: July 04, 2007, 02:59:21 AM »
Michael,

If this looks to you like a bug, I'll be happy to raise it on bugzilla, but first I'd like to be sure I haven't just missed something.

I'm seeing a failure to complete an initial backup on a new installation.

On a fresh installation of SME 7.1 updated to 7.1.3 on last Saturday, I have installed smeserver-affa-0.6.2-0.noarch.rpm by using yum localinstall.  After defining a job using the edited example config .pl file, and after sending the key to the remote host, I ran the job manually.  After this, a scheduled job ran and the log shows the same set of messages for both runs (only first set shown):

[root@smebackup1 ~]# tail -f /var/log/affa
<snip>
Tue Jul  3 20:24:36[START.4249]: Running /sbin/e-smith/affa --run mail3bu
Tue Jul  3 20:24:36[mail3bu.4249]: Checking connection to 192.168.111.1
Tue Jul  3 20:24:36[mail3bu.4249]: Starting job (192.168.111.1,scheduled)
Tue Jul  3 20:24:36[mail3bu.4249]: Description: mail3 backup on vm server
Tue Jul  3 20:24:36[mail3bu.4249]: Installing watchdog on 192.168.111.1
Tue Jul  3 20:24:36[mail3bu.4249]: signaling pre-backup event on 192.168.111.1
Tue Jul  3 20:24:40[mail3bu.4249]: writing list of installed RPMs on 192.168.111.1 (/home/e-smith/db/affa-rpmlist)
Tue Jul  3 20:24:47[mail3bu.4249]: Running rsync...
Tue Jul  3 20:25:21[mail3bu.4249]: writing /var/affa/mail3bu/scheduled.running/.AFFA-REPORT
Tue Jul  3 20:25:21[mail3bu.4249]: Comparing installed RPMs on backup und remote host
Tue Jul  3 20:25:21[mail3bu.4249]: Error 108: Couldn't open /var/affa/mail3bu/scheduled.0/home/e-smith/db/affa-rpmlist
Tue Jul  3 20:25:21[mail3bu.4249]: Email sent to admin,admin@mail3.guildassociates.com
Tue Jul  3 20:25:21[mail3bu.4249]: Exiting. <<<

Contents of /var/affa/mail3bu/scheduled.running/.AFFA-REPORT :
Date: 200707032030
Number of files: 85791
Number of files transferred: 7
Total file size: 12356544483 bytes
Total transferred file size: 27877374 bytes
Literal data: 0 bytes
Matched data: 27877374 bytes
File list size: 2506816
File list generation time: 2.452 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 42498
Total bytes received: 2507136
sent 42498 bytes  received 2507136 bytes  113317.07 bytes/sec
total size is 12356544483  speedup is 4846.40
Exit status: 0
RootDirFilesystemUsed: 13831100 kbytes
RootDirFilesystemAvail: 24897168 kbytes
RootDirFilesystemUsage: 35.7 %

No  /var/affa/mail3bu/scheduled.0 exists, only a  /var/affa/mail3bu/scheduled.running

I saw this same thing happen on a different machine with smeserver-affa-0.6.1

Any ideas?

Mark

Offline timb

  • **
  • 41
  • +0/-0
    • http://www.tbitc.com
last backup - never
« Reply #92 on: July 04, 2007, 08:10:11 AM »
Hi,
I love affa - I have it used it to change the hardware on a 1.0T server to 1.5T (it took a really long time) and I now have a  1.2T server backing up the new 1.5T server. Yes it wlll work at least 0.5T is not being backed up.

Anyway affa --status always reports the last backup occured never. I have backup's scheduled every 4 hours.

Here's a little evidence
[root@galland ~]# affa --status
Affa version 0.6.1 on galland (10.0.0.2)
+--------+---------+--------+-------+--------+------------+----------------+
| Job    | Enabled | Last   | Next  |   Size | Disk usage | N of s,d,w,m,y |
+--------+---------+--------+-------+--------+------------+----------------+
| office | yes     | never  | 18:00 |      - |  842GB/75% | 0,0,0,0,0      |
+--------+---------+--------+-------+--------+------------+----------------+
[root@galland ~]#  time affa --backup office

real    56m38.535s
user    2m15.837s
sys     6m16.195s
[root@galland ~]# affa --status
Affa version 0.6.1 on galland.tbitc.com (10.0.0.2)
+--------+---------+--------+-------+--------+------------+----------------+
| Job    | Enabled | Last   | Next  |   Size | Disk usage | N of s,d,w,m,y |
+--------+---------+--------+-------+--------+------------+----------------+
| office | yes     | never  | 18:00 |      - |  842GB/75% | 0,0,0,0,0      |
+--------+---------+--------+-------+--------+------------+----------------+
[root@galland ~]#

Offline m

  • ****
  • 276
  • +0/-0
  • Peet
[ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #93 on: July 04, 2007, 01:53:14 PM »
Mark,
timb,

both issues appear to be bugs.

Please raise a bug in the bugtracker contribs section.
Thank you.

Offline timb

  • **
  • 41
  • +0/-0
    • http://www.tbitc.com
Before I post as a bug... confessions
« Reply #94 on: July 05, 2007, 04:46:05 AM »
Hi,
My iissue may have been a broken fs.

Briefly here's what I have done / am doing

After posting my rant yesterday - I started hand checking the size of the /var/affa/office/scheduled.running dir and all the shells I used hung.

Warning bells screamed.  A reboot, a damaged fs....

hours running e2fsck - a frightening amount of errors

A reboot.

removed  /var/affa/office/scheduled.running - this took quite some time

a reboot - file system clean

Now running a backup.

It will be a long long time before this completes - its about 900GB over 1G nics....

I will post again when the backup finishes. So count me out of bug reporting till I know my system is not blameless.....

Confession - my hardware is a bit of a hack - it's an intel server m/b (older model) with 2 satas and raid control, with a cheapo 4 port sata card and 6 320gb enterprise drives.

This is not the first FS error we have had (it's the second in 90 days) and I am starting to suspect that this is not a great solution..... built from spare parts you see..

PS Can you get affa to email after every backup?  No matter what? I get backups didnt run emails rarely but thats all. They are a result of me hand launching a backup and then a scheduled one runs.
timb

Offline m

  • ****
  • 276
  • +0/-0
  • Peet
Re: Before I post as a bug... confessions
« Reply #95 on: July 05, 2007, 08:21:10 AM »
Quote from: "timb"

I will post again when the backup finishes.

Then also check the output of affa --list office

Quote from: "timb"


PS Can you get affa to email after every backup?  


Yes. Search for 'chattyOnSuccess' in the Affa wiki

markseymour

[ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #96 on: July 06, 2007, 02:01:00 AM »
Michael,

Thanks for the rapid bug fix!

[root@mail3backup ~]# affa --status
Affa version 0.6.3 on mail3backup.nnnn.com (192.168.111.345)
+----------+---------+--------+-------+--------+------------+----------------+
| Job      | Enabled | Last   | Next  |   Size | Disk usage | N of s,d,w,m,y |
+----------+---------+--------+-------+--------+------------+----------------+
| mail3bak | yes     | 17:31  | 20:30 |   12GB |   73GB/28% | 2,0,0,0,0      |
+----------+---------+--------+-------+--------+------------+----------------+


Mark

Offline timb

  • **
  • 41
  • +0/-0
    • http://www.tbitc.com
Issues I have encountered
« Reply #97 on: August 01, 2007, 02:34:48 AM »
I have been expanding my affa installation and I encountered some trouble.
Before I rush to log bugs...

Here's my set up
-----------------------------------------------------------------------------------------------
customer servers(sme) -> internet -> office server (rsync not affa for customers) - local lan

local lan ->affa server (dedicated) for office server
               -> affa2 (sme server) for internal workstations
              -> workstations - linux (of course)
----------------------------------------------------------------------------------------------
Notes
The goal here is that the server office and all workstations should have 1 backup on affa or affa2
Customers data should have 2 backups one on office and one on affa server

customer rsyncs to /var/customer
I used to rsync to /home/e-smith/files/users/customername/home/servername BUT when you do upgrades the S50imaprelocate script collects all the emails in /home/e-smith/files/users/customername/home/servername/home/e-smith/files/users/.... and puts it in weird directories in /home/e-smith/files/users/ and deletes the originals, thus making all backups out of date by the all user email - which in my case means about 24Gb!  It also makes 24gb of disk space dissappear for every yum update you do AND the signal-event post-upgrade takes about 4hrs to run!
I havent logged it as a bug because I think I am miss-using smeserver the way I had things.


I intend to migrate my rsync customer backup system to affa - just would like to see my affa server pickup all of the office server first.
-----------------------------------------------------------------------------------------------

Issue 1:
The customer backups are fine on office - my rsync works well - it's about 2 years old
affa2 contains NO customer backups ie office:/var/customer doesnt propagate
I have added an include statement  'Include[0]'=>'/var/customer
still doesn't propagate.

Issue 2:
affa2 configured to backup workstations with SMEServer No, backs up only /root on the workstations
Setting up 'Include[0]'=>'/'
doesn't help

Sorry for the length of this post
Clues anyone?

Offline m

  • ****
  • 276
  • +0/-0
  • Peet
Re: Issues I have encountered
« Reply #98 on: August 03, 2007, 11:16:27 AM »
Quote from: "timb"
/home/e-smith/files/users/customername/home/servername BUT when you do upgrades the S50imaprelocate script collects all the emails in


What is S50imaprelocate? I don't know this script.

Offline m

  • ****
  • 276
  • +0/-0
  • Peet
Re: Issues I have encountered
« Reply #99 on: August 03, 2007, 11:25:13 AM »
Quote from: "timb"

Issue 1:
The customer backups are fine on office - my rsync works well - it's about 2 years old
affa2 contains NO customer backups ie office:/var/customer doesnt propagate
I have added an include statement  'Include[0]'=>'/var/customer
still doesn't propagate.

Issue 2:
affa2 configured to backup workstations with SMEServer No, backs up only /root on the workstations
Setting up 'Include[0]'=>'/'
doesn't help


Would you please raise a bug in the bugtracker for each issue? Please provide the Affa config. (Output of 'db affa show JOBNAME'). Issue 2: Please provide the output of 'df' command ran on the workstation.

Offline dadoudidon

  • *
  • 84
  • +0/-0
Re: [ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #100 on: October 18, 2007, 06:20:57 PM »
I would like to save all my server 7.2 to an usb disk.
so only one sme in production and a usbdisk connected to save all backups.
for the moment only directories etc, root and home are saved.
I have some application also in opt so i think that more directories have to be backed up.
Here is the list of all directories of my system:

/bin
/boot
/command
/dev
/etc allready saved by affa
/home allready saved by affa
/initrd
/lib
/lost+found
/media (this is where my usbdisk is mounted)
/mnt
/opt
/package
/proc
/root allready saved by affa
/sbin
/selinux
/service
/srv
/sys
/tmp
/usr
/var
and some files at the root of the partition

I think that some directories can be bypass even if i move hardware, but others are needed to retreive a functionnaly server (contribs, template customs...)

Thanks n advance for your help

David
« Last Edit: October 18, 2007, 06:23:36 PM by dadoudidon »

Offline piran

  • ****
  • 502
  • +0/-0
Re: [ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #101 on: October 18, 2007, 07:34:46 PM »
David----
Perhaps you use an inappropriate tool?
AFFA is all about backups across the internet or intranet.
DAR2 is (mostly) about backups in the same box or shares.
http://wiki.contribs.org/DAR2
It does all that is needed to restore a complete server.
If you wish or have capacity it will also do your ibays.
My own (h/w) 2TB mounted RAID5 array is backed up
to a 1.5TB Maxtor OneTouchIII Turbo box that's working
in Linux mode and on a USB2 port. Takes ~14hrs to run
off something like 1.2TB overnight, so it is possible.
If you have distributed capacity on the intranet then
DAR2 will use network shared devices or NAS boxes.
----best wishes, Robert

Offline raem

  • *
  • 3,972
  • +4/-0
Re: [ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #102 on: October 19, 2007, 07:39:43 AM »
dadoudidon

> I would like to save all my server 7.2 to an usb disk.

An alternative if you use RAID1 (2 disks), you can put one of the drives in the server in a removable caddie, and have a spare drive that you swap in/out when you want a full copy of your working server (with all installed apps etc).
Hot swap is not yet supported so you need to power down for 2 minutes.

Make sure you erase the spare disk (in another machine ideally) before you swap the spare drive back in again or the server may resync the drives to the wrong (old) data set.
...

guest22

Re: [ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #103 on: January 02, 2008, 01:48:40 PM »
Michael,

Just installed Affa 0.8.0, it simply works. Many thanks for this very useful tool.

guest

Offline SoftDux

  • ****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: [ANNOUNCEMENT] Turn SME7 into a dedicated backup server
« Reply #104 on: April 14, 2008, 07:27:39 AM »
Without reading thought 7 pages worth of stuff, maybe someone could give me some answers to this one. affa doesn't seem to backup at all.

I have a USB HDD attached to my server, and it's haven't disconnected it in days. Here's my config:

Quote
# EDIT THIS:
# used as a key for db and as a filename!
# Choose a name with <= 10 chars.
my $jobname='backup';

# EDIT THIS:
my %job=(
        'remoteHostName'=>'192.168.10.5', # FQHN or IP address
        'TimeSchedule'=>'2230', # HHMM,HHMM,...
        'Description'=>'', # text string.
        'scheduledKeep'=>1, # integer >= 1
        'dailyKeep'=>7, # integer >= 1
        'weeklyKeep'=>4,# integer >= 1
        'monthlyKeep'=>12,# integer >= 1
        'yearlyKeep'=>2,# integer >= 1
        'SMEServer'=>'yes', # yes | no
        'Include[0]'=>'', # additional files or directories to include
        'Include[1]'=>'/etc/mrepo.conf',
        'Include[2]'=>'/etc/mrepo.conf.d',
        'Include[3]'=>'/etc/upsmon/',
        'Exclude[0]'=>'', # files or directories to exclude from backup
        #'Exclude[1]'=>'',
        #'Exclude[2]'=>'',
        'RPMCheck'=>'no', # yes | no
        'DiskSpaceWarn'=>'strict', # strict | normal | risky | none
        'localNice'=>0, # -19...+19
        'remoteNice'=>0, # -19...+19
        'Watchdog'=>'yes', # yes | no
        'sshPort'=>22, # default ssh port is 22
        'ConnectionCheckTimeout'=>120, # seconds
        'rsyncTimeout'=>900, # seconds
        'rsyncCompress'=>'yes', # yes | no
        'EmailAddresses'=>'', # name@domain.com,name@domain.com,...
        'chattyOnSuccess'=>0, # send N success notifications
        'postJobCommand'=>'', # full path to local program/script
        'preJobCommand'=>'', # full path to local program/script
        'AutomountDevice'=>'/dev/sdc2', # Device to auto mount (e.g. USB drive)
        'AutomountPoint'=>'media/usbdisk/', # the mountpoint for AutomountDevice
        'AutomountOptions'=>'', # Optionstring passed to mount command e.g. '-t cifs'
        'AutoUnmount'=>'yes', # umount if fs was not mounted before Affa ran
        'RootDir'=>'/media/usbdisk/affa', # where to save the archives. Don't use /root or /home/e-smith
        'Debug'=>'yes', # yes | no
        'status'=>'enabled', # enabled | disabled
        'rsync--inplace'=>'yes', # yes | no : rsync on source supports '--inplace' option
        'rsync--modify-window'=>0, # integer >= 0, timestamp window
        );

And then when I query the archives, I get the following:

Quote
[root@intranet ~]# affa --list-archives backup
Affa version 0.10.0-1 on intranet.office.softdux.com (192.168.10.5)
+------------------------------------------------------------------------------+
| Job: backup                                                                  |
| Description:                                                                 |
| Directory: /media/usbdisk/affa/backup/                                       |
| Hostname: localhost                                                          |
| AutomountDevice: /dev/sdc2                                                   |
| AutomountPoint: media/usbdisk/                                               |
| AutoUnmount: yes                                                             |
| Email: admin                                                                 |
+-----------------------+----------------+--------------+--------+-------------+
| Date                  | Archive        |        Files |   Size |  Disk usage |
+-----------------------+----------------+--------------+--------+-------------+
[root@intranet ~]#

Here's the funny thing:

Quote
[root@intranet ~]# ll /media/usbdisk/
total 92603180
?---------  ? ?    ?              ?            ? affa
drwx------  4 root root        4096 Mar  7 18:58 backup
drwx------  2 root root       16384 Mar  7 11:37 lost+found
-rw-r--r--  1 root root 94733019884 Apr  8 01:06 smeserver.tgz

I had a folder called affa, which now gives me some funny ? thing, why / what is that?