ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] Bacula и regex | wild в наборе файлов
@ 2010-01-18 14:55 Денис Ягофаров
  2010-01-18 17:10 ` Rinat Shigapov
  0 siblings, 1 reply; 3+ messages in thread
From: Денис Ягофаров @ 2010-01-18 14:55 UTC (permalink / raw)
  To: ALT Linux Community

[-- Attachment #1: Type: text/plain, Size: 3082 bytes --]

Доброго времени суток.

Пробую при помощи Bacula 3.0.3 забрать бекапы репозиториев (они сделаны 
отдельным скриптом). Все файлы имеют вид SVN*gz.
Не получается скопировать только их - жадная Бакула копирует всё в 
целевой папке. Создаётся впечатление, что RegEx и Wild не работают на 
включение файлов в бекап.

Попытка 1:

# This is the backup of the SVN
FileSet {
   Name = "SVNDump"
   Include {
     Options {
         signature = MD5
         RegEx = "^/tmp/SVN.*gz$"
         }
     File = "/tmp"
    }
}

Проверяю:

estimate job=BackupSVN listing client=storeFd001

Connecting to Client storeFd001 at store.itc.lan:9102

-rw-r--r-- 1 root root 47 2010-01-18 12:22:57 /tmp/w_test

-rw-r--r-- 1 root root 0 2010-01-18 12:21:56 /tmp/SVNtest.inc.16-31.gz

-rw-r--r-- 1 root root 0 2010-01-18 12:21:44 /tmp/SVNtest.full.gz

-rw------- 1 root root 0 2010-01-17 18:32:30 /tmp/session_mm_phpini0.sem

drwx-----T 2 cacheman man 40 2010-01-18 04:02:05 /tmp/.private/cacheman
...

drwxrwxrwt 7 root root 240 2010-01-18 15:32:13 /tmp

2000 OK estimate files=15 bytes=33,633

Хм.... если добавить exclude = yes , регулярное выражение начинает работать:

Connecting to Client storeFd001 at store.itc.lan:9102

-rw-r--r-- 1 root root 47 2010-01-18 12:22:57 /tmp/w_test

-rw------- 1 root root 0 2010-01-17 18:32:30 /tmp/session_mm_phpini0.sem
drwx-----T 2 cacheman man 40 2010-01-18 04:02:05 /tmp/.private/cacheman

...

drwxrwxrwt 7 root root 240 2010-01-18 15:32:13 /tmp

2000 OK estimate files=13 bytes=33,633


Попытка 2:

# This is the backup of the SVN
FileSet {
   Name = "SVNDump"
   Include {
     Options {
         signature = MD5
         Wild = "/tmp/SVN*gz"
         }
     File = "/tmp"
    }
}

Проверяю:

estimate job=BackupSVN listing client=storeFd001

Connecting to Client storeFd001 at store.itc.lan:9102

-rw-r--r-- 1 root root 47 2010-01-18 12:22:57 /tmp/w_test

-rw-r--r-- 1 root root 0 2010-01-18 12:21:56 /tmp/SVNtest.inc.16-31.gz

-rw-r--r-- 1 root root 0 2010-01-18 12:21:44 /tmp/SVNtest.full.gz

-rw------- 1 root root 0 2010-01-17 18:32:30 /tmp/session_mm_phpini0.sem

drwx-----T 2 cacheman man 40 2010-01-18 04:02:05 /tmp/.private/cacheman

...

drwxrwxrwt 7 root root 240 2010-01-18 15:32:13 /tmp 2000 OK estimate 
files=15 bytes=33,633


Хм.... если добавить exclude = yes , wild-выражение начинает работать:


estimate job=BackupSVN listing client=storeFd001
Connecting to Client storeFd001 at store.itc.lan:9102
-rw-r--r-- 1 root root 47 2010-01-18 12:22:57 /tmp/w_test
-rw------- 1 root root 0 2010-01-17 18:32:30 /tmp/session_mm_phpini0.sem
drwx-----T 2 cacheman man 40 2010-01-18 04:02:05 /tmp/.private/cacheman
...
drwxrwxrwt 7 root root 240 2010-01-18 15:32:13 /tmp
2000 OK estimate files=13 bytes=33,633


[-- Attachment #2: denyago.vcf --]
[-- Type: text/x-vcard, Size: 385 bytes --]

begin:vcard
fn:Denis Timurovich Yagofarov
n:Yagofarov;Denis Timurovich
org:ITGIS NASU
adr:room 615;;Chokolovski blvdr., 13;Kiev;;03151;Ukraine
email;internet:denyago@rambler.ru
title:system administrator
tel;work:80445201209
tel;cell:80662933760
note;quoted-printable:xmmp: denyago@gmail.com=0D=0A=
	xmmp: diyago@jabber.te.ua
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Comm] Bacula и regex | wild в наборе файлов
  2010-01-18 14:55 [Comm] Bacula и regex | wild в наборе файлов Денис Ягофаров
@ 2010-01-18 17:10 ` Rinat Shigapov
  2010-01-21 22:11   ` Di
  0 siblings, 1 reply; 3+ messages in thread
From: Rinat Shigapov @ 2010-01-18 17:10 UTC (permalink / raw)
  To: ALT Linux Community general discussions

Привожу отрывок из документации:
Now, lets assume you only want to backup .Z and .gz files and nothing 
else. This is a bit trickier because Bacula by default will select 
everything to backup, so we must exclude everything but .Z and .gz 
files. If we take the first example above and make the obvious 
modifications to it, we might come up with a FileSet that looks like this:

FileSet {
   Name = "Full Set"
   Include {                    !!!!!!!!!!!!
      Options {                    This
         wildfile = "*.Z"          example
         wildfile = "*.gz"         doesn't
                                   work
      }                          !!!!!!!!!!!!
      File = /myfile
   }
}

The *.Z and *.gz files will indeed be backed up, but all other files 
that are not matched by the Options directives will automatically be 
backed up too (i.e. that is the default rule).

To accomplish what we want, we must explicitly exclude all other files. 
We do this with the following:
FileSet {
   Name = "Full Set"
   Include {
      Options {
         wildfile = "*.Z"
         wildfile = "*.gz"
      }
      Options {
         Exclude = yes
         RegexFile = ".*"
      }
      File = /myfile
   }
}
The "trick" here was to add a RegexFile expression that matches all 
files. It does not match directory names, so all directories in /myfile 
will be backed up (the directory entry) and any *.Z and *.gz files 
contained in them. If you know that certain directories do not contain 
any *.Z or *.gz files and you do not want the directory entries backed 
up, you will need to explicitly exclude those directories. Backing up a 
directory entries is not very expensive.

-- 
С уважением,
         инженер-программист ООО "Невод"
         Ринат Шигапов
         Jabber ID: dxist эт ya.ru


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Comm] Bacula и regex | wild в наборе файлов
  2010-01-18 17:10 ` Rinat Shigapov
@ 2010-01-21 22:11   ` Di
  0 siblings, 0 replies; 3+ messages in thread
From: Di @ 2010-01-21 22:11 UTC (permalink / raw)
  To: community

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

On 18.01.2010 19:10, Rinat Shigapov wrote:
> Привожу отрывок из документации:

Огромное спасибо! Заработало:

FileSet {
   Name = "SVNDump"
   Include {
     Options {
         signature = MD5
         Wildfile = "/tmp/SVN*gz"
         }
     Options {
         Exclude = yes
         RegexFile = ".*"
         RegexDir = ".*"
     }

     File = "/tmp"
    }
}

Стыд и позор моей невнимательности =\


[-- Attachment #2: denyago.vcf --]
[-- Type: text/x-vcard, Size: 366 bytes --]

begin:vcard
fn:Denis Timurovich Yagofarov
n:Yagofarov;Denis Timurovich
org:ITGIS NASU
adr:room 615;;Chokolovski blvdr., 13;Kiev;;03151;Ukraine
email;internet:denyago@rambler.ru
title:system administrator
tel;work:80442480755
tel;pager:diyago@jabber.te.ua
tel;home:80442434512
tel;cell:80662933760
note:diyago@jabber.te.ua
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-21 22:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-18 14:55 [Comm] Bacula и regex | wild в наборе файлов Денис Ягофаров
2010-01-18 17:10 ` Rinat Shigapov
2010-01-21 22:11   ` Di

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git