Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: Morgo on June 02, 2007, 09:26:15 AM

Title: Exclude an ibay from backup
Post by: Morgo on June 02, 2007, 09:26:15 AM
Hey all,
Can anybody tell me how to exclude an ibay from a tape backup. I have an ibay directory full of music that takes up too much room an does not need backing up
regularly. It fills my tape so I just want to exclude that one directory from backing up.
Title: Exclude an ibay from backup
Post by: mmccarn on June 02, 2007, 05:55:18 PM
Looking at /etc/e-smith/templates/etc/flexbackup.conf/10Exclude_expr00, you might be able to exclude an ibay using (note the tiny dot at the end of the third line):
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/flexbackup.conf
cd /etc/e-smith/templates-custom/etc/flexbackup.conf
cp /etc/e-smith/templates/etc/flexbackup.conf/10Exclude_expr00 .
pico -w 10Exclude_expr00

and add $exclude_expr[2] = 'ibays/<ibayname>'; to the bottom of the file.  Save your changes, run expand-template /etc/flexbackup.conf

(You might want to test this before playing with the templates by simply adding the $exclude_expr[2]... line to /etc/flexbackup.conf and running a backup... Just be sure to template it before you forget or the changes will disappear at some point when you're not expecting it...)
Title: Exclude an ibay from backup
Post by: Morgo on June 04, 2007, 02:52:39 AM
Thanks for your reply. I did a trial like you suggested and it failed. Here is a copy of the log. Could you help me further. The directory I excluded is home/e-smith/files/ibays/music . Any help would be appreciated.



flexbackup version 1.2.1 (http://flexbackup.sourceforge.net)
/etc/flexbackup.conf syntax OK

 $keyfile not found in config: default=00-index-key
 $buffer_fill_pct not found in config: default=75
 $buffer_pause_usec not found in config: default=100
|------------------------------------------------------------
| Checking 'buffer' on this machine... Ok
| Checking /bin/sh on this machine... bash1
|------------------------------------------------------------
| Doing level 0 backup of set all using tar
| All sets = full (1 tapes)
| Rewinding & erasing tape...
| Found index key 200706030200, next file is 2
| Deleting record for 200706030200 file 0
| Deleting record for 200706030200 file 1
|------------------------------------------------------------
| Creating index key 200706040200
| Backup set "full" (/)
| Tape #0
|------------------------------------------------------------
SCSI 2 tape drive:
File number=1, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x13 (DDS (61000 bpi)).
Soft error count since last status=0
General status bits on (81010000):
 EOF ONLINE IM_REP_EN
|------------------------------------------------------------
| File number 1, tape index 200706040200
| Backup of: /
| Date of this level 0 backup: Mon Jun 04 02:00:17 2007
| Date of last level 0 backup: the epoch
|------------------------------------------------------------
| cd "/" && /tmp/collectexit.32348.sh find . -depth -xdev ! -type s ! \
|   -regex "news/articles" ! -regex ".*~"$ ! -regex \
|   "home/e-smith/files/ibays/music" -print0 | /tmp/collectexit.32348.sh \
|   tar --create --null --files-from=- --ignore-failed-read \
|   --same-permissions --no-recursion --totals --label "level 0 / Mon Jun \
|   04 02:00:17 2007 tar+gzip from darwin" --sparse --atime-preserve -b 64 \
|   --file - | /tmp/collectexit.32348.sh gzip -4 | \
|   /tmp/collectexit.32348.sh buffer -m 20m -p 75 -s 32k -t -u 100 -B -o \
|   "/dev/nst0"
| [ ! -e /tmp/exitstatus.32348 ]
|------------------------------------------------------------
buffer (writer): write of data failed: No space left on device
bytes to write=32768, bytes written=-1, total written   10157216K

ERROR: non-zero exit from:
buffer -m 20m -p 75 -s 32k -t -u 100 -B -o /dev/nst0
gzip -4
tar --create --null --files-from=- --ignore-failed-read --same-permissions --no-recursion --totals --label level 0 / Mon Jun 04 02:00:17 2007 tar+gzip from darwin --sparse --atime-preserve -b 64 --file -
find . -depth -xdev ! -type s ! -regex news/articles ! -regex .*~$ ! -regex home/e-smith/files/ibays/music -print0


ERROR: exiting
|------------------------------------------------------------
| Backup start: Mon Jun 04 02:00:17 2007
| Backup end:   Mon Jun 04 04:55:52 2007
|------------------------------------------------------------
SCSI 2 tape drive:
File number=2, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x13 (DDS (61000 bpi)).
Soft error count since last status=0
General status bits on (81010000):
 EOF ONLINE IM_REP_EN
|------------------------------------------------------------
| Rewinding...
| Compressing log (all.0.200706040200.gz)
| Linking all.latest.gz -> all.0.200706040200.gz
|------------------------------------------------------------
Backup terminated: backup failed - status: 256
Title: Exclude an ibay from backup
Post by: mrjhb3 on June 04, 2007, 05:14:10 AM
Quote from: "Morgo"
Thanks for your reply. I did a trial like you suggested and it failed. Here is a copy of the log. Could you help me further. The directory I excluded is home/e-smith/files/ibays/music . Any help would be appreciated.

[snip]
| cd "/" && /tmp/collectexit.32348.sh find . -depth -xdev ! -type s ! \
|   -regex "news/articles" ! -regex ".*~"$ ! -regex \
|   "home/e-smith/files/ibays/music" -print0 | /tmp/collectexit.32348.sh \
|   tar --create --null --files-from=- --ignore-failed-read \
|   --same-permissions --no-recursion --totals --label "level 0 / Mon Jun \
|   04 02:00:17 2007 tar+gzip from darwin" --sparse --atime-preserve -b 64 \
|   --file - | /tmp/collectexit.32348.sh gzip -4 | \
|   /tmp/collectexit.32348.sh buffer -m 20m -p 75 -s 32k -t -u 100 -B -o \
|   "/dev/nst0"
| [ ! -e /tmp/exitstatus.32348 ]
|------------------------------------------------------------
buffer (writer): write of data failed: No space left on device
bytes to write=32768, bytes written=-1, total written   10157216K

ERROR: non-zero exit from:
buffer -m 20m -p 75 -s 32k -t -u 100 -B -o /dev/nst0
gzip -4
tar --create --null --files-from=- --ignore-failed-read --same-permissions --no-recursion --totals --label level 0 / Mon Jun 04 02:00:17 2007 tar+gzip from darwin --sparse --atime-preserve -b 64 --file -
find . -depth -xdev ! -type s ! -regex news/articles ! -regex .*~$ ! -regex home/e-smith/files/ibays/music -print0


That needs to be /home/e-smith/files/ibays/music you are missing the first /
or you could try
Code: [Select]
config setprop flexbackup Prune /home/e-smith/files/ibays/music followed by
Code: [Select]
expand-template /etc/flexbackup.conf Then look at your flexbackup.conf file and you should see your new setting in the Prune section.

John
Title: Exclude an ibay from backup
Post by: mmccarn on June 04, 2007, 06:17:53 AM
Quote from: "mrjhb3"
config setprop flexbackup Prune...
Yes, that looks much easier than my "solution"...

It also looks like you may be able to specify multiple folders to "prune" by separating them with a comma?
Title: Exclude an ibay from backup
Post by: Morgo on June 05, 2007, 03:19:13 AM
Hi  

Thanks for the reply, I did what you suggested and got the following error.

flexbackup version 1.2.1 (http://flexbackup.sourceforge.net)
/etc/flexbackup.conf syntax OK

 $keyfile not found in config: default=00-index-key
 $buffer_fill_pct not found in config: default=75
 $buffer_pause_usec not found in config: default=100
|------------------------------------------------------------
| Checking 'buffer' on this machine... Ok
| Checking /bin/sh on this machine... bash1
|------------------------------------------------------------
| Doing level 0 backup of set all using tar
| All sets = full (1 tapes)
| Rewinding & erasing tape...
| Found index key 200706040200, next file is 2
| Deleting record for 200706040200 file 0
| Deleting record for 200706040200 file 1
|------------------------------------------------------------
| Creating index key 200706050200
| Backup set "full" (/)
| Tape #0
|------------------------------------------------------------
SCSI 2 tape drive:
File number=1, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x13 (DDS (61000 bpi)).
Soft error count since last status=0
General status bits on (81010000):
 EOF ONLINE IM_REP_EN
|------------------------------------------------------------
| File number 1, tape index 200706050200
| Backup of: /
| Date of this level 0 backup: Tue Jun 05 02:00:17 2007
| Date of last level 0 backup: the epoch
|------------------------------------------------------------
| cd "/" && /tmp/collectexit.4805.sh find . -regex \
|   "\./\(/home/e-smith/files/ibays/music\)/.*" -prune -o -xdev ! -type s ! \
|   -regex "news/articles" ! -regex ".*~"$ -print0 | \
|   /tmp/collectexit.4805.sh tar --create --null --files-from=- \
|   --ignore-failed-read --same-permissions --no-recursion --totals --label \
|   "level 0 / Tue Jun 05 02:00:17 2007 tar+gzip from darwin" --sparse \
|   --atime-preserve -b 64 --file - | /tmp/collectexit.4805.sh gzip -4 | \
|   /tmp/collectexit.4805.sh buffer -m 20m -p 75 -s 32k -t -u 100 -B -o \
|   "/dev/nst0"
| [ ! -e /tmp/exitstatus.4805 ]
|------------------------------------------------------------
buffer (writer): write of data failed: No space left on device
bytes to write=32768, bytes written=-1, total written   10163520K

ERROR: non-zero exit from:
buffer -m 20m -p 75 -s 32k -t -u 100 -B -o /dev/nst0
gzip -4
tar --create --null --files-from=- --ignore-failed-read --same-permissions --no-recursion --totals --label level 0 / Tue Jun 05 02:00:17 2007 tar+gzip from darwin --sparse --atime-preserve -b 64 --file -
find . -regex \./\(/home/e-smith/files/ibays/music\)/.* -prune -o -xdev ! -type s ! -regex news/articles ! -regex .*~$ -print0


ERROR: exiting
|------------------------------------------------------------
| Backup start: Tue Jun 05 02:00:17 2007
| Backup end:   Tue Jun 05 04:55:49 2007
|------------------------------------------------------------
SCSI 2 tape drive:
File number=2, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x13 (DDS (61000 bpi)).
Soft error count since last status=0
General status bits on (81010000):
 EOF ONLINE IM_REP_EN
|------------------------------------------------------------
| Rewinding...
| Compressing log (all.0.200706050200.gz)
| Linking all.latest.gz -> all.0.200706050200.gz
|------------------------------------------------------------
Backup terminated: backup failed - status: 256
Title: Exclude an ibay from backup
Post by: mmccarn on June 05, 2007, 05:03:15 PM
man flexbackup.conf implies that if you wanted to use "exclude" you would need to use this in /etc/flexbackup.conf:
$exclude_expr[2] ='.*/ibays/music/.*';

Another suggestion from the flexbackup FAQ (http://www.edwinh.org/flexbackup/faq.html) is to test your proposed exclude or prune expression (for the '/' filesystem) using:
Code: [Select]
cd /; find . -regex "<expression>"

I *think* but can't prove that the difference between 'exclude' and 'prune' is that you want your exclude expression to match every file name to be excluded, but that your prune expression should match a folder name whose entire contents are to be excluded.  So, using the test expression above, your choices would be:

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/flexbackup.conf
cd /etc/e-smith/templates-custom/etc/flexbackup.conf
cp /etc/e-smith/templates/etc/flexbackup.conf/10Exclude_expr00 .
echo "\$exclude_expr[2] = '.*/ibays/music/.*';" >> 10Exclude_expr00
expand-template /etc/flexbackup.conf
(note: the backslash before $exclude_expr[2] allows shell redirection as shown here.  If you edit the custom 10Exclude_expr00 file manually it should not be included!)

or
Code: [Select]
config setprop flexbackup Prune '.*/ibays/music'
expand-template /etc/flexbackup.conf


And lastly - since flexbackup is filesystem specific, your music will be automatically excluded if you put it on another file system (like a USB drive) and mount that file system in /home/e-smith/files/ibays/music...